Viewing file: MenusSeeder.php (8.67 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace Database\Seeders;
use App\Models\Category; use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; use Illuminate\Support\Carbon;
class MenusSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { $categories = [ [ 'id' => 1, 'user_id' => 2, 'name' => 'Fish', 'image' => 'category/fish_pics.jpg', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ], [ 'id' => 2, 'user_id' => 2, 'name' => 'Mutton', 'image' => 'category/mutton.png', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ], [ 'id' => 3, 'user_id' => 2, 'name' => 'Deshi Mutton', 'image' => 'category/mutton_deshi.jpg', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ], [ 'id' => 4, 'user_id' => 2, 'name' => 'Non-Vegetarian', 'image' => 'category/non_veg_pics.jpg', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ], [ 'id' => 5, 'user_id' => 2, 'name' => 'Vegetarian', 'image' => 'category/veg_pics.jpg', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now() ], ];
Category::insert($categories);
$taxes = [ [ 'user_id' => 2, 'title' => 'Standard VAT', 'amount' => 5, 'type' => 'percentage', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'title' => 'Service Tax', 'amount' => 2, 'type' => 'flat', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], ];
DB::table('taxes')->insert($taxes);
$items = [ [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 2, 'tax_id' => rand(1, 2), 'name' => 'Chicken Achari Tikka', 'details' => 'Delicious Chicken Achari Tikka prepared with authentic spices.', 'price' => 10.99, 'discount' => 5, 'discount_type' => 'percent', 'discount_to' => 'everyone', 'image' => 'items/Chicken_achari_tikka.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 2, 'tax_id' => rand(1, 2), 'name' => 'Chicken Curry', 'details' => 'Delicious Chicken Curry prepared with authentic spices.', 'price' => 12.50, 'discount' => 0, 'discount_type' => 'flat', 'discount_to' => 'everyone', 'image' => 'items/chicken_curry.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 4, 'tax_id' => rand(1, 2), 'name' => 'Chicken Fry', 'details' => 'Delicious Chicken Fry prepared with authentic spices.', 'price' => 15.75, 'discount' => 3, 'discount_type' => 'percent', 'discount_to' => 'everyone', 'image' => 'items/Chicken_Fry.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 4, 'tax_id' => rand(1, 2), 'name' => 'Chicken Kathi Rolls', 'details' => 'Delicious Chicken Kathi Rolls prepared with authentic spices.', 'price' => 9.99, 'discount' => 2, 'discount_type' => 'flat', 'discount_to' => 'everyone', 'image' => 'items/chicken_kathi_rolls.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 1, 'tax_id' => rand(1, 2), 'name' => 'Fish Curry1', 'details' => 'Delicious Fish Curry1 prepared with authentic spices.', 'price' => 20.00, 'discount' => 10, 'discount_type' => 'percent', 'discount_to' => 'everyone', 'image' => 'items/fish_curry1.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 1, 'tax_id' => rand(1, 2), 'name' => 'Fish Fry Amritsari1', 'details' => 'Delicious Fish Fry Amritsari1 prepared with authentic spices.', 'price' => 8.45, 'discount' => 0, 'discount_type' => 'flat', 'discount_to' => 'everyone', 'image' => 'items/fish_fry_amritsari1.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 1, 'tax_id' => rand(1, 2), 'name' => 'Fish Tikka1', 'details' => 'Delicious Fish Tikka1 prepared with authentic spices.', 'price' => 13.49, 'discount' => 7, 'discount_type' => 'percent', 'discount_to' => 'everyone', 'image' => 'items/Fish_tikka1.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 4, 'tax_id' => rand(1, 2), 'name' => 'Chicken Seekh Kabab', 'details' => 'Delicious Chicken Seekh Kabab prepared with authentic spices.', 'price' => 11.11, 'discount' => 2, 'discount_type' => 'flat', 'discount_to' => 'everyone', 'image' => 'items/Chicken_Seekh_Kabab.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 5, 'tax_id' => rand(1, 2), 'name' => 'Veg Triple Rice', 'details' => 'Delicious Veg Triple Rice prepared with authentic spices.', 'price' => 17.89, 'discount' => 4, 'discount_type' => 'percent', 'discount_to' => 'everyone', 'image' => 'items/Veg_triple_rice.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], [ 'user_id' => 2, 'restaurant_id' => 1, 'category_id' => 5, 'tax_id' => rand(1, 2), 'name' => 'Veg Fried Rice', 'details' => 'Delicious Veg Fried Rice prepared with authentic spices.', 'price' => 14.00, 'discount' => 5, 'discount_type' => 'flat', 'discount_to' => 'everyone', 'image' => 'items/veg_fried_rice.jpg', 'status' => 'active', 'created_at' => now(), 'updated_at' => now(), ], ];
DB::table('items')->insert($items); } }
|