Completed
Branch master (beb88f)
by Mohamed
05:11 queued 03:39
created

ServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 11
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Moo\FlashCard;
4
5
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
6
use Moo\FlashCard\Command\CreateCard;
7
use Moo\FlashCard\Command\CreateCategory;
8
9
class ServiceProvider extends BaseServiceProvider
10
{
11
    /**
12
     * Bootstrap any application services.
13
     *
14
     * @return void
15
     */
16
    public function boot()
17
    {
18
        // Load database migration classes
19
        $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
20
21
        // Load command line tool for add cards or categories
22
        if ($this->app->runningInConsole()) {
23
            $this->commands([
24
                CreateCard::class,
25
                CreateCategory::class,
26
            ]);
27
        }
28
29
        // Load API routes
30
        $this->loadRoutesFrom(__DIR__.'/../../routes/api.php');
31
    }
32
}
33