Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function __invoke(UploadImageRequest $request) |
||
18 | { |
||
19 | $this->authorize('viewAny', AppSettings::class); |
||
20 | |||
21 | // Storage Path |
||
22 | $path = 'images/logo'; |
||
23 | $location = '/storage/'.Storage::disk('public')->putFile($path, new File($request->file)); |
||
|
|||
24 | |||
25 | AppSettings::firstOrCreate( |
||
26 | ['key' => 'app.logo'], |
||
27 | ['key' => 'app.logo', 'value' => $location] |
||
28 | )->update([ |
||
29 | 'value' => $location |
||
30 | ]); |
||
31 | |||
32 | event(new NewLogoUploadedEvent($location)); |
||
33 | return response()->noContent(); |
||
34 | } |
||
36 |