forked from a1gard/xshop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Database\Factories\CategoryFactory;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
use Xmen\StarterKit\Models\Category;
|
|
|
|
class CategorySeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
//
|
|
$items = [
|
|
[
|
|
'name' => 'درباره ما',
|
|
'slug' => 'درباره-ما',
|
|
],
|
|
[
|
|
'name' => 'تماس با ما',
|
|
'slug' => 'تماس-با-ما',
|
|
],
|
|
[
|
|
'name' => 'اخبار',
|
|
'slug' => 'اخبار',
|
|
],
|
|
[
|
|
'name' => 'سوالات متداول',
|
|
'slug' => 'سوالات-متداول',
|
|
],
|
|
[
|
|
'name' => 'مقالات',
|
|
'slug' => 'مقالات',
|
|
],
|
|
|
|
];
|
|
foreach ($items as $item){
|
|
$c = new Category();
|
|
$c->name = $item['name'];
|
|
$c->slug = $item['slug'];
|
|
$c->save();
|
|
}
|
|
|
|
}
|
|
}
|