Conditions | 4 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
8 | public static function route($enable = ['store', 'delete'], callable $callback = null): void |
||
9 | { |
||
10 | Route::prefix('files')->group(function () use ($enable, $callback) { |
||
11 | $namespace = '\\UniSharp\\Uploadable\\Http\\Controllers\\Api\\V1\\'; |
||
12 | |||
13 | if (in_array('store', $enable)) { |
||
14 | Route::post('/', $namespace . 'UploadController@store'); |
||
15 | } |
||
16 | |||
17 | if (in_array('delete', $enable)) { |
||
18 | Route::delete('{file}', $namespace . 'UploadController@destroy'); |
||
19 | } |
||
20 | |||
21 | if ($callback) { |
||
22 | $callback(); |
||
23 | } |
||
27 |