1 | <?php namespace Modules\Media\Http\Controllers\Admin; |
||
11 | class MediaController extends AdminBaseController |
||
12 | { |
||
13 | /** |
||
14 | * @var FileRepository |
||
15 | */ |
||
16 | private $file; |
||
17 | /** |
||
18 | * @var Repository |
||
19 | */ |
||
20 | private $config; |
||
21 | /** |
||
22 | * @var Imagy |
||
23 | */ |
||
24 | private $imagy; |
||
25 | /** |
||
26 | * @var ThumbnailsManager |
||
27 | */ |
||
28 | private $thumbnailsManager; |
||
29 | |||
30 | public function __construct(FileRepository $file, Repository $config, Imagy $imagy, ThumbnailsManager $thumbnailsManager) |
||
31 | { |
||
32 | parent::__construct(); |
||
33 | $this->file = $file; |
||
34 | $this->config = $config; |
||
35 | $this->imagy = $imagy; |
||
36 | $this->thumbnailsManager = $thumbnailsManager; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Display a listing of the resource. |
||
41 | * |
||
42 | * @return Response |
||
43 | */ |
||
44 | public function index() |
||
52 | |||
53 | /** |
||
54 | * Show the form for creating a new resource. |
||
55 | * |
||
56 | * @return Response |
||
57 | */ |
||
58 | public function create() |
||
62 | |||
63 | /** |
||
64 | * Show the form for editing the specified resource. |
||
65 | * |
||
66 | * @param File $file |
||
67 | * @return Response |
||
68 | */ |
||
69 | public function edit(File $file) |
||
70 | { |
||
71 | $thumbnails = $this->thumbnailsManager->all(); |
||
72 | |||
73 | return view('media::admin.edit', compact('file', 'thumbnails')); |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * Update the specified resource in storage. |
||
78 | * |
||
79 | * @param File $file |
||
80 | * @param UpdateMediaRequest $request |
||
81 | * @return Response |
||
82 | */ |
||
83 | public function update(File $file, UpdateMediaRequest $request) |
||
91 | |||
92 | /** |
||
93 | * Remove the specified resource from storage. |
||
94 | * |
||
95 | * @param File $file |
||
96 | * @internal param int $id |
||
97 | * @return Response |
||
98 | */ |
||
99 | public function destroy(File $file) |
||
108 | } |
||
109 |