source: app/Http/Controllers/InvoiceController.php

Last change on this file was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago
  • Initial commit;
  • Property mode set to 100644
File size: 763 bytes
Line 
1<?php
2
3namespace App\Http\Controllers;
4
5use Illuminate\Http\Request;
6use Illuminate\Support\Facades\Auth;
7
8class 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.