@@ 15-23 (lines=9) @@ | ||
12 | /** |
|
13 | * @return $this |
|
14 | */ |
|
15 | public function index() |
|
16 | { |
|
17 | $data = Auth::user()->payees()->orderBy('last_used_at', 'desc')->orderBy('name')->get(); |
|
18 | ||
19 | return fractal() |
|
20 | ->collection($data) |
|
21 | ->transformWith(new PayeeTransformer()) |
|
22 | ->toArray(); |
|
23 | } |
|
24 | ||
25 | public function store(Request $request) |
|
26 | { |
|
@@ 25-35 (lines=11) @@ | ||
22 | ->toArray(); |
|
23 | } |
|
24 | ||
25 | public function store(Request $request) |
|
26 | { |
|
27 | $this->validate($request, ['name' => 'required|string']); |
|
28 | ||
29 | $payee = Auth::user()->payees()->create($request->all()); |
|
30 | ||
31 | return fractal() |
|
32 | ->item($payee) |
|
33 | ->transformWith(new PayeeTransformer()) |
|
34 | ->toArray(); |
|
35 | } |
|
36 | } |
|
37 |