Test Failed
Push — master ( b6687a...d5e75a )
by Julien
06:32
created

TournamentsServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 1
1
<?php
2
3
namespace Xoco70\LaravelTournaments;
4
5
use Illuminate\Routing\Router;
6
use Illuminate\Support\ServiceProvider;
7
8
class TournamentsServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     *
13
     * @param Router $router
14
     *
15
     * @return void
16
     */
17
    public function boot(Router $router)
18
    {
19
        $viewPath = __DIR__.'/../resources/views';
20
        $this->loadViewsFrom($viewPath, 'laravel-tournaments');
21
22
        $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
23
        $this->loadTranslationsFrom(__DIR__.'/../translations', 'laravel-tournaments');
24
25
        $this->publishes([__DIR__.'/../database/migrations' => $this->app->databasePath().'/migrations'], 'migrations');
0 ignored issues
show
Bug introduced by
The method databasePath() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean basePath()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
26
        $this->publishes([__DIR__.'/../database/seeds' => $this->app->databasePath().'/seeds'], 'seeds');
0 ignored issues
show
Bug introduced by
The method databasePath() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean basePath()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
27
        $this->publishes([__DIR__.'/../database/factories' => $this->app->databasePath().'/factories'], 'seeds');
0 ignored issues
show
Bug introduced by
The method databasePath() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean basePath()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
28
        $this->publishes([__DIR__.'/../resources/assets' => public_path('vendor/laravel-tournaments')], 'assets');
29
30
        $router->group(['prefix' => 'laravel-tournaments', 'middleware' => ['web']], function ($router) {
31
            $router->get('/', 'Xoco70\LaravelTournaments\TreeController@index')->name('tree.index');
32
            $router->post('/championships/{championship}/trees', 'Xoco70\LaravelTournaments\TreeController@store')->name('tree.store');
33
            $router->put('/championships/{championship}/trees', 'Xoco70\LaravelTournaments\TreeController@update')->name('tree.update');
34
        });
35
    }
36
37
    /**
38
     * Register the application services.
39
     *
40
     * @return void
41
     */
42
    public function register()
43
    {
44
        $this->app->make(TreeController::class);
45
        $this->app->make(DBHelpers::class);
46
    }
47
}
48