| Conditions | 3 |
| Paths | 4 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function boot() |
||
| 13 | { |
||
| 14 | if ($this->app->runningInConsole()) { |
||
| 15 | $this->commands([ |
||
| 16 | ChuckNorrisJoke::class, |
||
| 17 | ]); |
||
| 18 | } |
||
| 19 | |||
| 20 | $this->loadViewsFrom(__DIR__.'/../resources/views', 'chuck-norris'); |
||
| 21 | |||
| 22 | $this->publishes([ |
||
| 23 | __DIR__.'/../resources/views' => resource_path('views/vendor/chuck-norris'), |
||
| 24 | ], 'views'); |
||
| 25 | |||
| 26 | $this->publishes([ |
||
| 27 | __DIR__.'/../config/chuck-norris.php' => base_path('config/chuck-norris.php'), |
||
| 28 | ], 'config'); |
||
| 29 | |||
| 30 | if (! class_exists('CreateJokesTable')) { |
||
| 31 | $this->publishes([ |
||
| 32 | __DIR__.'/../database/migrations/create_jokes_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_jokes_table.php'), |
||
| 33 | ], 'migrations'); |
||
| 34 | } |
||
| 35 | |||
| 36 | Route::get(config('chuck-norris.route'), ChuckNorrisController::class); |
||
| 37 | } |
||
| 38 | |||
| 48 |