Completed
Push — master ( 0e6fef...ce3620 )
by Matt
13:51
created

QuizzesTableSeeder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B run() 0 27 1
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
            'quiz_pin' => '1234',
21
            'active'  => '0',
22
            'created_at' => date('Y-m-d H:i:s'),
23
            'updated_at' => date('Y-m-d H:i:s')
24
        ],
25
        [
26
            'quiz_name' => 'Discrete Mathematics & Functional Programmimg',
27
            'quiz_description' => 'This is a quiz to test your knowledge on Discrete Mathematics & Functional Programming',
28
            'quiz_pin' => '2345',
29
            'active'  => '1',
30
            'created_at' => date('Y-m-d H:i:s'),
31
            'updated_at' => date('Y-m-d H:i:s')
32
        ],
33
        [
34
            'quiz_name' => 'Colours of the rainbow',
35
            'quiz_description' => 'Fancy a challenge? Then test your knowhow on the colours of the rainbow',
36
            'quiz_pin' => '3456',
37
            'active'  => '1',
38
            'created_at' => date('Y-m-d H:i:s'),
39
            'updated_at' => date('Y-m-d H:i:s')
40
        ]
41
        ]);
42
    }
43
}
44