@@ -50,7 +50,7 @@ |
||
| 50 | 50 | Providers\RouteServiceProvider::class, |
| 51 | 51 | ]); |
| 52 | 52 | |
| 53 | - $this->app->booting(function ($app) { |
|
| 53 | + $this->app->booting(function($app) { |
|
| 54 | 54 | /** @var \Illuminate\Contracts\Config\Repository $config */ |
| 55 | 55 | $config = $app['config']; |
| 56 | 56 | |
@@ -150,7 +150,7 @@ |
||
| 150 | 150 | $type = $request->get('type'); |
| 151 | 151 | $path = $request->get('path'); |
| 152 | 152 | |
| 153 | - if ($type === MediaItem::TYPE_FILE){ |
|
| 153 | + if ($type === MediaItem::TYPE_FILE) { |
|
| 154 | 154 | $this->manager->deleteFile($path); |
| 155 | 155 | } |
| 156 | 156 | elseif ($type === MediaItem::TYPE_DIRECTORY) { |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function map(): void |
| 25 | 25 | { |
| 26 | - $this->adminGroup(function () { |
|
| 27 | - $this->prefix('media')->name('media.')->group(function () { |
|
| 26 | + $this->adminGroup(function() { |
|
| 27 | + $this->prefix('media')->name('media.')->group(function() { |
|
| 28 | 28 | $this->get('/', [MediaController::class, 'index']) |
| 29 | 29 | ->name('index'); // admin::media.index |
| 30 | 30 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | private function mapApiRoutes(): void |
| 40 | 40 | { |
| 41 | - $this->prefix('api')->name('api.')->middleware(['ajax'])->group(function () { |
|
| 41 | + $this->prefix('api')->name('api.')->middleware(['ajax'])->group(function() { |
|
| 42 | 42 | $this->get('items', [MediaApiController::class, 'all']) |
| 43 | 43 | ->name('items.index'); // admin::media.api.items.index |
| 44 | 44 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function rules() |
| 28 | 28 | { |
| 29 | - $manager = static::getMediaManager(); |
|
| 29 | + $manager = static::getMediaManager(); |
|
| 30 | 30 | |
| 31 | 31 | return [ |
| 32 | 32 | 'old_path' => ['required', 'string', new MediaItemExistsRule($manager)], |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $disk = $this->disk(); |
| 94 | 94 | $directories = $disk->directories($directory, $recursive); |
| 95 | 95 | |
| 96 | - return MediaCollection::directories(array_map(function ($path) use ($disk) { |
|
| 96 | + return MediaCollection::directories(array_map(function($path) use ($disk) { |
|
| 97 | 97 | return [ |
| 98 | 98 | 'name' => basename($path), |
| 99 | 99 | ]; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $disk = $this->disk(); |
| 114 | 114 | $files = $disk->files($directory, $recursive); |
| 115 | 115 | |
| 116 | - return MediaCollection::files(array_map(function ($path) use ($disk) { |
|
| 116 | + return MediaCollection::files(array_map(function($path) use ($disk) { |
|
| 117 | 117 | return [ |
| 118 | 118 | 'name' => basename($path), |
| 119 | 119 | 'path' => $path, |
@@ -135,18 +135,18 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public function file(string $path) |
| 137 | 137 | { |
| 138 | - return $this->files(dirname($path))->first(function (FileItem $file) use ($path) { |
|
| 138 | + return $this->files(dirname($path))->first(function(FileItem $file) use ($path) { |
|
| 139 | 139 | return $file->path === $path; |
| 140 | - }, function () use ($path) { |
|
| 140 | + }, function() use ($path) { |
|
| 141 | 141 | throw new FileNotFoundException("File [$path] not found!"); |
| 142 | 142 | }); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | public function directory(string $path) |
| 146 | 146 | { |
| 147 | - return $this->directories(dirname($path))->first(function (DirectoryItem $directory) use ($path) { |
|
| 147 | + return $this->directories(dirname($path))->first(function(DirectoryItem $directory) use ($path) { |
|
| 148 | 148 | return $directory->path === $path; |
| 149 | - }, function () use ($path) { |
|
| 149 | + }, function() use ($path) { |
|
| 150 | 150 | throw new DirectoryNotFoundException("Directory [$path] not found!"); |
| 151 | 151 | }); |
| 152 | 152 | } |