diff --git a/app/Http/Controllers/Portal/Payments.php b/app/Http/Controllers/Portal/Payments.php index 82eefc662..d9ce57df8 100644 --- a/app/Http/Controllers/Portal/Payments.php +++ b/app/Http/Controllers/Portal/Payments.php @@ -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')); + } } diff --git a/config/search-string.php b/config/search-string.php index 5317dd6d3..f65dfa820 100644 --- a/config/search-string.php +++ b/config/search-string.php @@ -295,4 +295,19 @@ return [ ], ], + App\Models\Portal\Banking\Transaction::class => [ + 'columns' => [ + 'paid_at' => ['date' => true], + 'amount', + 'currency_code' => [ + 'route' => 'portal.payment.currencies' + ], + 'document_id', + 'description' => ['searchable' => true], + 'payment_method', + 'reference', + 'parent_id', + ], + ], + ]; diff --git a/resources/views/portal/payments/index.blade.php b/resources/views/portal/payments/index.blade.php index 7b130d90a..3ba9da383 100644 --- a/resources/views/portal/payments/index.blade.php +++ b/resources/views/portal/payments/index.blade.php @@ -13,9 +13,8 @@ ]) !!}