first commit
This commit is contained in:
51
app/Http/Controllers/Customers/Payments.php
Normal file
51
app/Http/Controllers/Customers/Payments.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Customers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Income\Revenue as Payment;
|
||||
use App\Models\Setting\Category;
|
||||
use App\Models\Banking\Account;
|
||||
|
||||
use App\Utilities\Modules;
|
||||
|
||||
use Auth;
|
||||
|
||||
|
||||
class Payments extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$payments = Payment::with('account', 'category')->where('customer_id', '=', Auth::user()->customer->id)->paginate();
|
||||
|
||||
$payment_methods = Modules::getPaymentMethods();
|
||||
|
||||
$categories = collect(Category::enabled()->type('income')->pluck('name', 'id'))
|
||||
->prepend(trans('categories.all'), '');
|
||||
|
||||
$accounts = collect(Account::enabled()->pluck('name', 'id'))
|
||||
->prepend(trans('accounts.all'), '');
|
||||
|
||||
return view('customers.payments.index', compact('payments', 'payment_methods', 'categories', 'accounts'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for viewing the specified resource.
|
||||
*
|
||||
* @param Payment $payment
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show(Payment $payment)
|
||||
{
|
||||
$payment_methods = Modules::getPaymentMethods();
|
||||
|
||||
return view('customers.payments.show', compact('payment', 'payment_methods'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user