Portal > Payment search and filter
This commit is contained in:
@ -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'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user