migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Modules\Restaurant\Models\MenuCategory;
|
||||
use Modules\Restaurant\Models\MenuSection;
|
||||
|
||||
class MenuSectionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$sections = [
|
||||
// Coffee
|
||||
[
|
||||
'menu_category' => 'Coffee',
|
||||
'name' => 'Hot Coffee',
|
||||
'description' => 'Classic and premium hot coffee menu.',
|
||||
'priority' => 1,
|
||||
'status' => true,
|
||||
],
|
||||
[
|
||||
'menu_category' => 'Coffee',
|
||||
'name' => 'Cold Coffee',
|
||||
'description' => 'Iced and refreshing cold coffee menu.',
|
||||
'priority' => 2,
|
||||
'status' => true,
|
||||
],
|
||||
|
||||
// Fast Food
|
||||
[
|
||||
'menu_category' => 'Fast Food',
|
||||
'name' => 'Burgers',
|
||||
'description' => 'Delicious burgers made fresh to order.',
|
||||
'priority' => 1,
|
||||
'status' => true,
|
||||
],
|
||||
[
|
||||
'menu_category' => 'Fast Food',
|
||||
'name' => 'Wraps',
|
||||
'description' => 'Tasty wraps filled with fresh ingredients.',
|
||||
'priority' => 2,
|
||||
'status' => true,
|
||||
],
|
||||
|
||||
// Pizza
|
||||
[
|
||||
'menu_category' => 'Pizza',
|
||||
'name' => 'Regular Pizzas',
|
||||
'description' => 'Classic pizzas with standard toppings.',
|
||||
'priority' => 1,
|
||||
'status' => true,
|
||||
],
|
||||
[
|
||||
'menu_category' => 'Pizza',
|
||||
'name' => 'Special Pizzas',
|
||||
'description' => 'Signature pizzas with unique flavors.',
|
||||
'priority' => 2,
|
||||
'status' => true,
|
||||
],
|
||||
|
||||
// Desi Menu
|
||||
[
|
||||
'menu_category' => 'Desi Menu',
|
||||
'name' => 'Rice Items',
|
||||
'description' => 'Traditional rice dishes served with curry.',
|
||||
'priority' => 1,
|
||||
'status' => true,
|
||||
],
|
||||
[
|
||||
'menu_category' => 'Desi Menu',
|
||||
'name' => 'Curry Items',
|
||||
'description' => 'Spicy and flavorful local curries.',
|
||||
'priority' => 2,
|
||||
'status' => true,
|
||||
],
|
||||
|
||||
// Desserts
|
||||
[
|
||||
'menu_category' => 'Desserts',
|
||||
'name' => 'Cakes',
|
||||
'description' => 'Freshly baked cakes for every occasion.',
|
||||
'priority' => 1,
|
||||
'status' => true,
|
||||
],
|
||||
[
|
||||
'menu_category' => 'Desserts',
|
||||
'name' => 'Ice Creams',
|
||||
'description' => 'Cool and creamy ice cream delights.',
|
||||
'priority' => 2,
|
||||
'status' => true,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($sections as $sec) {
|
||||
$category = MenuCategory::where('name', $sec['menu_category'])->first();
|
||||
|
||||
if ($category) {
|
||||
MenuSection::updateOrCreate(
|
||||
['slug' => Str::slug($sec['name'])],
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'menu_category_id' => $category->id,
|
||||
'name' => $sec['name'],
|
||||
'slug' => Str::slug($sec['name']),
|
||||
'description' => $sec['description'],
|
||||
'priority' => $sec['priority'],
|
||||
'status' => $sec['status'],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user