1 | <?php |
||
2 | |||
3 | namespace NovaChunkedVideo; |
||
4 | |||
5 | use Illuminate\Support\Facades\Route; |
||
6 | use Laravel\Nova\Events\ServingNova; |
||
7 | use Laravel\Nova\Nova; |
||
8 | |||
9 | class ServiceProvider extends \Illuminate\Support\ServiceProvider |
||
10 | { |
||
11 | /** |
||
12 | * Bootstrap any application services. |
||
13 | * |
||
14 | * @return void |
||
15 | */ |
||
16 | 13 | public function boot() |
|
17 | { |
||
18 | 13 | if ($this->app->runningInConsole()) { |
|
19 | 13 | $this->publishes([ |
|
20 | 13 | __DIR__ . '/../config/nova-chunked.php' => config_path('nova-chunked.php'), |
|
21 | 13 | ], 'config'); |
|
22 | |||
23 | |||
24 | 13 | $this->commands([ |
|
25 | 13 | ]); |
|
26 | } |
||
27 | |||
28 | 13 | $this->app->booted(function () { |
|
29 | 13 | $this->routes(); |
|
30 | 13 | }); |
|
31 | |||
32 | 13 | Nova::serving(function (ServingNova $event) { |
|
0 ignored issues
–
show
|
|||
33 | 2 | Nova::script('chunked-video', __DIR__.'/../dist/js/field.js'); |
|
34 | 2 | Nova::style('chunked-video', __DIR__.'/../dist/css/field.css'); |
|
35 | 13 | }); |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * Register any application services. |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | 13 | public function register() |
|
44 | { |
||
45 | 13 | $this->mergeConfigFrom(__DIR__ . '/../config/nova-chunked.php', 'nova-chunked'); |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * Register the card's routes. |
||
50 | */ |
||
51 | 13 | protected function routes() |
|
52 | { |
||
53 | 13 | if ($this->app->routesAreCached()) { |
|
54 | return; |
||
55 | } |
||
56 | |||
57 | 13 | Route::middleware(['nova']) |
|
58 | 13 | ->prefix('nova-vendor/nova-chunked') |
|
59 | 13 | ->group(function () { |
|
60 | 13 | if (config('nova-chunked.use_package_routes')) { |
|
61 | 13 | Route::post( |
|
62 | 13 | '/video-upload/{resource}/{resourceId}/{field}', |
|
63 | 13 | [ \NovaChunkedVideo\Http\Controllers\VideoController::class, 'store' ] |
|
64 | 13 | )->name('nova.chunked-video.upload'); |
|
65 | } |
||
66 | 13 | }); |
|
67 | } |
||
68 | } |
||
69 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.