Completed
Push — master ( de266e...61eb5c )
by Abdelrahman
02:51
created

RinvexFortAbilitiesTableSeeder::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 2
nop 0
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Rinvex Fort Package.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Rinvex Fort Package
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
use Illuminate\Database\Seeder;
17
use Illuminate\Support\Facades\DB;
18
19
class RinvexFortAbilitiesTableSeeder extends Seeder
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
20
{
21
    /**
22
     * Run the database seeds.
23
     *
24
     * @return void
25
     */
26
    public function run()
27
    {
28
        DB::statement('SET FOREIGN_KEY_CHECKS=0;');
29
        DB::table(config('rinvex.fort.tables.abilities'))->truncate();
30
31
        // Get abilities data
32
        $abilities = require __DIR__.'/../../resources/data/abilities.php';
33
34
        // Create new abilities
35
        foreach ($abilities as $ability) {
36
            app('rinvex.fort.ability')->create($ability);
37
        }
38
39
        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
40
    }
41
}
42