Portal > Payment search and filter

This commit is contained in:
Cüneyt Şentürk
2021-01-12 22:21:59 +03:00
parent c1bfcb8b9a
commit c502b73632
4 changed files with 34 additions and 4 deletions

View File

@ -4,6 +4,7 @@ namespace App\Http\Controllers\Portal;
use App\Abstracts\Http\Controller;
use App\Models\Banking\Transaction;
use App\Models\Setting\Currency;
use App\Http\Requests\Portal\PaymentShow as Request;
use App\Utilities\Modules;
@ -16,7 +17,9 @@ class Payments extends Controller
*/
public function index()
{
$payments = Transaction::income()->where('contact_id', '=', user()->contact->id)->paginate();
$search = request()->get('search');
$payments = Transaction::income()->where('contact_id', '=', user()->contact->id)->usingSearchString($search)->sortable('paid_at')->paginate();
$payment_methods = Modules::getPaymentMethods('all');
@ -36,4 +39,16 @@ class Payments extends Controller
return view('portal.payments.show', compact('payment', 'payment_methods'));
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function currencies()
{
$currencies = Currency::collect();
return $this->response('portal.currencies.index', compact('currencies'));
}
}