mirror of https://github.com/4xmen/xshop.git
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.
60 lines
1.7 KiB
PHP
60 lines
1.7 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' => 'client.welcome',
|
|
'icon' => 'ri-layout-top-2-line',
|
|
],
|
|
[
|
|
'name' => 'post',
|
|
'valid_segments' => json_encode(
|
|
["top", "header", "footer", "menu",
|
|
"parallax", "other", "post", "comments"]
|
|
),
|
|
'max' => 6,
|
|
'preview' => 'client.post',
|
|
'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();
|
|
}
|
|
}
|
|
}
|