Issues (6)

src/ServiceProvider.php (1 issue)

1
<?php
2
3
namespace ThinkOne\NovaLaravelFilemanager;
4
5
use Illuminate\Support\Facades\Route;
6
use Laravel\Nova\Events\ServingNova;
7
use Laravel\Nova\Http\Middleware\Authenticate;
8
use Laravel\Nova\Nova;
9
use ThinkOne\NovaLaravelFilemanager\Http\Middleware\Authorize;
10
11
class ServiceProvider extends \Illuminate\Support\ServiceProvider
12
{
13
    /**
14
     * Bootstrap any application services.
15
     *
16
     * @return void
17
     */
18 6
    public function boot()
19
    {
20 6
        $this->app->booted(function () {
21 6
            $this->routes();
22 6
        });
23
24 6
        Nova::serving(function (ServingNova $event) {
25
            Nova::script('nova-laravel-filemanager', __DIR__ . '/../dist/js/field.js');
26
            Nova::style('nova-laravel-filemanager', __DIR__ . '/../dist/css/field.css');
27
            Nova::translations(__DIR__ . '/../lang/'.app()->getLocale().'.json');
0 ignored issues
show
The method getLocale() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

27
            Nova::translations(__DIR__ . '/../lang/'.app()->/** @scrutinizer ignore-call */ getLocale().'.json');
Loading history...
28
            Nova::translations(lang_path('vendor/nova-laravel-filemanager/'.app()->getLocale().'.json'));
29 6
        });
30
    }
31
32
    /**
33
     * Register any application services.
34
     *
35
     * @return void
36
     */
37 6
    public function register()
38
    {
39
        //
40 6
    }
41
42 6
    protected function routes()
43
    {
44 6
        if ($this->app->routesAreCached()) {
45
            return;
46
        }
47
48 6
        Nova::router(['nova', Authenticate::class, Authorize::class], 'nova-laravel-filemanager')
49 6
            ->group(__DIR__.'/../routes/inertia.php');
50
51 6
        Route::middleware(['nova', Authorize::class])
52 6
            ->prefix('nova-vendor/nova-laravel-filemanager')
53 6
            ->group(__DIR__.'/../routes/api.php');
54
    }
55
}
56