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.
xshop/database/seeders/AreaSeeder.php

50 lines
1.3 KiB
PHP

<?php
namespace Database\Seeders;
use App\Models\Area;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class AreaSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
$areas = [
[
'name' => 'preloader',
'valid_segments' => json_encode(
["preloader"]
),
'max' => 1,
'preview' => null,
'icon' => 'ri-loader-2-line',
],
[
'name' => 'index',
'valid_segments' => json_encode(
["top","slider","header","footer","menu",
"parallax","other","posts","products","attachments"
,"groups","categories","category","group","index"]
),
'max' => 10,
'preview' => 'welcome',
'icon' => 'ri-layout-top-2-line',
],
];
foreach ($areas as $area){
$a = new Area();
$a->name = $area['name'];
$a->max = $area['max'];
$a->valid_segments = $area['valid_segments'];
$a->icon = $area['icon'];
$a->preview = $area['preview'];
$a->save();
}
}
}