114 lines
3.1 KiB
PHP
114 lines
3.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
use App\Models\Category;
|
|
|
|
class CategorySeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$categories = [
|
|
['name' => 'Automotive'],
|
|
[
|
|
'name' => 'Business',
|
|
'children' => [
|
|
['name' => 'Trading'],
|
|
['name' => 'Information Technology'],
|
|
['name' => 'Marketing'],
|
|
['name' => 'Office'],
|
|
['name' => 'Telecommunications']
|
|
]
|
|
],
|
|
[
|
|
'name' => 'Entertainment',
|
|
'children' => [
|
|
['name' => 'Dating'],
|
|
['name' => 'Film & Television'],
|
|
['name' => 'Games & Toys'],
|
|
['name' => 'Music and Video'],
|
|
['name' => 'Adult Entertainment']
|
|
]
|
|
],
|
|
['name' => 'Food & Drink'],
|
|
[
|
|
'name' => 'Hobbies & Gifts',
|
|
'children' => [
|
|
['name' => 'Collectibles'],
|
|
['name' => 'Pets'],
|
|
['name' => 'Photography'],
|
|
['name' => 'Hunting & Fishing']
|
|
]
|
|
],
|
|
[
|
|
'name' => 'Education',
|
|
'children' => [
|
|
['name' => 'Languages']
|
|
]
|
|
],
|
|
['name' => 'Law'],
|
|
['name' => 'Politics'],
|
|
[
|
|
'name' => 'Shopping',
|
|
'children' => [
|
|
['name' => 'Home & Garden'],
|
|
['name' => 'Clothing & Accessories'],
|
|
['name' => 'Computer & Electronics']
|
|
]
|
|
],
|
|
[
|
|
'name' => 'Religion & Spirituality',
|
|
'children' => [
|
|
['name' => 'Holistic Health']
|
|
]
|
|
],
|
|
['name' => 'Real Estate'],
|
|
['name' => 'Social Networks'],
|
|
[
|
|
'name' => 'Society',
|
|
'children' => [
|
|
['name' => 'Family'],
|
|
['name' => 'Wedding'],
|
|
['name' => 'Immigration']
|
|
]
|
|
],
|
|
[
|
|
'name' => 'Wellness',
|
|
'children' => [
|
|
['name' => 'Health & Beauty'],
|
|
['name' => 'Psychology & Psychotherapy']
|
|
]
|
|
],
|
|
[
|
|
'name' => 'Tips & Tricks',
|
|
'children' => [
|
|
['name' => 'How to']
|
|
]
|
|
],
|
|
[
|
|
'name' => 'Travel',
|
|
'children' => [
|
|
['name' => 'Holiday'],
|
|
['name' => 'World Festivals'],
|
|
['name' => 'Outdoors']
|
|
]
|
|
],
|
|
];
|
|
|
|
|
|
foreach ($categories as $category)
|
|
{
|
|
$node = Category::create($category);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|