2017-09-14 22:21:00 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Customers;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
2017-12-11 11:01:44 +03:00
|
|
|
use App\Models\Income\Invoice;
|
2017-09-14 22:21:00 +03:00
|
|
|
|
|
|
|
class Dashboard extends Controller
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display a listing of the resource.
|
|
|
|
*
|
|
|
|
* @return Response
|
|
|
|
*/
|
|
|
|
public function index()
|
|
|
|
{
|
2017-12-11 11:01:44 +03:00
|
|
|
$customer = auth()->user()->customer;
|
|
|
|
|
|
|
|
$invoices = Invoice::with('status')->accrued()->where('customer_id', $customer->id)->get();
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2017-12-11 11:01:44 +03:00
|
|
|
return view('customers.dashboard.index', compact('customer', 'invoices'));
|
2017-09-14 22:21:00 +03:00
|
|
|
}
|
|
|
|
}
|