Last change
on this file was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago |
|
-
Property mode
set to
100644
|
File size:
763 bytes
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | namespace App\Http\Controllers;
|
---|
4 |
|
---|
5 | use Illuminate\Http\Request;
|
---|
6 | use Illuminate\Support\Facades\Auth;
|
---|
7 |
|
---|
8 | class InvoiceController extends Controller
|
---|
9 | {
|
---|
10 | public function __construct()
|
---|
11 | {
|
---|
12 | $this->middleware(['auth', 'verified', 'onboarding', 'role:organizer']);
|
---|
13 | }
|
---|
14 |
|
---|
15 | public function index()
|
---|
16 | {
|
---|
17 | $invoices = Auth::user()->invoicesIncludingPending();
|
---|
18 |
|
---|
19 | return view('web.organizer.invoices.invoices')
|
---|
20 | ->with('invoices', $invoices);
|
---|
21 | }
|
---|
22 |
|
---|
23 | public function show($invoiceId)
|
---|
24 | {
|
---|
25 | $invoice = Auth::user()->findInvoice($invoiceId);
|
---|
26 |
|
---|
27 | if (!is_null($invoice)) {
|
---|
28 | return Auth::user()->downloadInvoice($invoiceId, [], 'CLAPSIFY-' . $invoice->number);
|
---|
29 |
|
---|
30 | }
|
---|
31 |
|
---|
32 | return abort(404);
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.