Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class CustomerDataController extends Controller |
||
9 | { |
||
10 | /** |
||
11 | * After the users selected some tickets, they must enter their |
||
12 | * contact information to receive them after payment |
||
13 | */ |
||
14 | public function getData() |
||
15 | { |
||
16 | // Check if all required previous inputs are present |
||
17 | // Else sent user back to where he has to start/comence |
||
18 | if (!session()->has('event')) { |
||
19 | return redirect()->route('ts.events'); |
||
20 | } |
||
21 | if (!session()->has('tickets')) { |
||
22 | return redirect()->route('ts.seatmap', ['event' => session('event')->id]); |
||
23 | } |
||
24 | |||
25 | $data = []; |
||
26 | if (session()->has('customerData')) { |
||
27 | $data = session('customerData'); |
||
28 | } |
||
29 | |||
30 | // data is structured like the form attributes in the view |
||
31 | return view('ticketshop.customer-data', ['data' => $data]); |
||
32 | } |
||
33 | |||
34 | public function setData(SetCustomerData $request) |
||
38 | } |
||
39 | } |