GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#11)
by
unknown
01:37
created

WebTinkerServiceProvider::registerRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\WebTinker;
4
5
use Illuminate\Support\Facades\Gate;
6
use Illuminate\Support\Facades\Route;
7
use Illuminate\Support\ServiceProvider;
8
use Spatie\WebTinker\Console\InstallCommand;
9
use Spatie\WebTinker\Http\Middleware\Authorize;
10
use Spatie\WebTinker\Http\Controllers\WebTinkerController;
11
12
class WebTinkerServiceProvider extends ServiceProvider
13
{
14
    public function boot()
15
    {
16
        if ($this->app->runningInConsole()) {
17
            $this->publishes([
18
                __DIR__.'/../config/web-tinker.php' => config_path('web-tinker.php'),
19
            ], 'config');
20
21
            $this->publishes([
22
                __DIR__.'/../resources/views' => base_path('resources/views/vendor/web-tinker'),
23
            ], 'views');
24
25
            $this->publishes([
26
                __DIR__.'/../public' => public_path('vendor/web-tinker'),
27
            ], 'web-tinker-assets');
28
        }
29
30
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'web-tinker');
31
32
        $this
33
            ->registerRoutes()
34
            ->registerWebTinkerGate();
35
    }
36
37
    public function register()
38
    {
39
        $this->mergeConfigFrom(__DIR__.'/../config/web-tinker.php', 'web-tinker');
40
41
        $this->commands(InstallCommand::class);
42
    }
43
44
    protected function registerRoutes()
45
    {
46
        Route::prefix(config('web-tinker.path'))->middleware(Authorize::class)->group(function () {
47
            Route::get('/', [WebTinkerController::class, 'index']);
48
            Route::post('/', [WebTinkerController::class, 'execute']);
49
        });
50
51
        return $this;
52
    }
53
54
    protected function registerWebTinkerGate()
55
    {
56
        Gate::define('viewWebTinker', function ($user = null) {
0 ignored issues
show
Unused Code introduced by
The parameter $user is not used and could be removed.

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

Loading history...
57
            return app()->environment('local');
58
        });
59
60
        return $this;
61
    }
62
}
63