Issues (4)

src/ServiceProvider.php (1 issue)

Severity
1
<?php
2
3
namespace NovaEntitySelectField;
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 9
    public function boot()
17
    {
18 9
        $this->app->booted(function () {
19 9
            $this->routes();
20 9
        });
21
22 9
        Nova::serving(function (ServingNova $event) {
0 ignored issues
show
The parameter $event is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

22
        Nova::serving(function (/** @scrutinizer ignore-unused */ ServingNova $event) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
23 6
            Nova::script('entity-select-field', __DIR__ . '/../dist/js/field.js');
24 6
            Nova::style('entity-select-field', __DIR__ . '/../dist/css/field.css');
25 9
        });
26
    }
27
28
    /**
29
     * Register the tool's routes.
30
     *
31
     * @return void
32
     */
33 9
    protected function routes()
34
    {
35 9
        if ($this->app->routesAreCached()) {
36
            return;
37
        }
38
39 9
        Route::middleware(['nova'])
40 9
            ->prefix('nova-vendor/nova-entity-select-field')
41 9
            ->group(__DIR__.'/../routes/api.php');
42
    }
43
44
    /**
45
     * Register any application services.
46
     *
47
     * @return void
48
     */
49 9
    public function register()
50
    {
51
        //
52 9
    }
53
}
54