2017-09-14 22:21:00 +03:00
|
|
|
<?php
|
|
|
|
|
2020-01-20 13:39:32 +03:00
|
|
|
namespace App\Http\Controllers\Portal;
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
use App\Abstracts\Http\Controller;
|
|
|
|
use App\Models\Banking\Transaction;
|
2021-01-12 22:21:59 +03:00
|
|
|
use App\Models\Setting\Currency;
|
2020-09-06 17:06:10 +03:00
|
|
|
use App\Http\Requests\Portal\PaymentShow as Request;
|
2017-09-14 22:21:00 +03:00
|
|
|
use App\Utilities\Modules;
|
|
|
|
|
|
|
|
class Payments extends Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Display a listing of the resource.
|
|
|
|
*
|
|
|
|
* @return Response
|
|
|
|
*/
|
|
|
|
public function index()
|
|
|
|
{
|
2021-01-12 22:21:59 +03:00
|
|
|
$search = request()->get('search');
|
|
|
|
|
|
|
|
$payments = Transaction::income()->where('contact_id', '=', user()->contact->id)->usingSearchString($search)->sortable('paid_at')->paginate();
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2017-11-29 19:37:16 +03:00
|
|
|
$payment_methods = Modules::getPaymentMethods('all');
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2020-11-06 00:43:46 +03:00
|
|
|
return $this->response('portal.payments.index', compact('payments', 'payment_methods'));
|
2017-09-14 22:21:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show the form for viewing the specified resource.
|
|
|
|
*
|
2019-11-16 10:21:14 +03:00
|
|
|
* @param Transaction $payment
|
2017-09-14 22:21:00 +03:00
|
|
|
*
|
|
|
|
* @return Response
|
|
|
|
*/
|
2020-09-06 17:06:10 +03:00
|
|
|
public function show(Transaction $payment, Request $request)
|
2017-09-14 22:21:00 +03:00
|
|
|
{
|
2019-11-16 10:21:14 +03:00
|
|
|
$payment_methods = Modules::getPaymentMethods('all');
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
return view('portal.payments.show', compact('payment', 'payment_methods'));
|
2017-09-14 22:21:00 +03:00
|
|
|
}
|
2021-01-12 22:21:59 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Display a listing of the resource.
|
|
|
|
*
|
|
|
|
* @return Response
|
|
|
|
*/
|
|
|
|
public function currencies()
|
|
|
|
{
|
|
|
|
$currencies = Currency::collect();
|
|
|
|
|
|
|
|
return $this->response('portal.currencies.index', compact('currencies'));
|
|
|
|
}
|
2017-09-14 22:21:00 +03:00
|
|
|
}
|