Passed
Branch master (4ff80c)
by Matt
14:34
created

QuizzesTableSeeder::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
nc 1
nop 0
dl 0
loc 21
rs 9.3142
c 1
b 0
f 0
1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
class QuizzesTableSeeder 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...
6
{
7
    private $table = 'quizzes';
8
    /**
9
     * Run the database seeds.
10
     *
11
     * @return void
12
     */
13
    public function run()
14
    {
15
        DB::table($this->table)->truncate();
16
        DB::table($this->table)->insert([
17
        [
18
            'quiz_name' => 'Data Structures & Algorithms',
19
            'quiz_description' => 'This is a quiz to test your knowledge on Data Structures & Algorithms',
20
            'created_at' => date('Y-m-d H:i:s'),
21
            'updated_at' => date('Y-m-d H:i:s')
22
        ],
23
        [
24
            'quiz_name' => 'Discrete Mathematics & Functional Programmimg',
25
            'quiz_description' => 'This is a quiz to test your knowledge on Discrete Mathematics & Functional Programming',
26
            'created_at' => date('Y-m-d H:i:s'),
27
            'updated_at' => date('Y-m-d H:i:s')
28
        ],
29
        [
30
            'quiz_name' => 'Colours of the rainbow',
31
            'quiz_description' => 'Fancy a challenge? Then test your knowhow on the colours of the rainbow',
32
            'created_at' => date('Y-m-d H:i:s'),
33
            'updated_at' => date('Y-m-d H:i:s')
34
        ]
35
        ]);
36
    }
37
}
38