|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
use Illuminate\Database\Seeder; |
|
4
|
|
|
use Illuminate\Support\Facades\DB; |
|
5
|
|
|
|
|
6
|
|
|
class ArticlesTableSeeder extends Seeder |
|
|
|
|
|
|
7
|
|
|
{ |
|
8
|
|
|
/** |
|
9
|
|
|
* Run the database seeds. |
|
10
|
|
|
* |
|
11
|
|
|
* @return void |
|
12
|
|
|
*/ |
|
13
|
|
|
public function run() |
|
14
|
|
|
{ |
|
15
|
|
|
DB::table('articles')->insert([[ |
|
16
|
|
|
'id' => 1, |
|
17
|
|
|
'user_id' => 1, |
|
18
|
|
|
'content' => 'Some Content', |
|
19
|
|
|
'metas' => '{"meta_title":"Meta Title Value","meta_description":"Meta Description Value"}', |
|
20
|
|
|
'tags' => '{"tags":["tag1","tag2","tag3"]}', |
|
21
|
|
|
'extras' => '{"extra_details":["detail1","detail2","detail3"]}', |
|
22
|
|
|
'cast_metas' => '{"cast_meta_title":"Meta Title Value","cast_meta_description":"Meta Description Value"}', |
|
23
|
|
|
'cast_tags' => '{"cast_tags":["tag1","tag2","tag3"]}', |
|
24
|
|
|
'cast_extras' => '{"cast_extra_details":["detail1","detail2","detail3"]}', |
|
25
|
|
|
]]); |
|
26
|
|
|
|
|
27
|
|
|
DB::table('articles')->insert([[ |
|
28
|
|
|
'id' => 2, |
|
29
|
|
|
'user_id' => 2, |
|
30
|
|
|
'content' => 'Some Content', |
|
31
|
|
|
'metas' => '{"meta_title":"Meta Title Value","meta_description":"Meta Description Value"}', |
|
32
|
|
|
'tags' => '{"tags":["tag1","tag2","tag3"]}', |
|
33
|
|
|
'extras' => '{"extra_details":["detail1","detail2","detail3"]}', |
|
34
|
|
|
'cast_metas' => '{"cast_meta_title":"Meta Title Value","cast_meta_description":"Meta Description Value"}', |
|
35
|
|
|
'cast_tags' => '{"cast_tags":["tag1","tag2","tag3"]}', |
|
36
|
|
|
'cast_extras' => '{"cast_extra_details":["detail1","detail2","detail3"]}', |
|
37
|
|
|
]]); |
|
38
|
|
|
} |
|
39
|
|
|
} |
|
40
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.