New Initial Commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class AdminUserSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
User::create([
|
||||
'name' => 'Admin User',
|
||||
'email' => 'admin@additionaldesign.com',
|
||||
'password' => Hash::make('password'),
|
||||
'is_admin' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
use WithoutModelEvents;
|
||||
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$this->call([
|
||||
AdminUserSeeder::class,
|
||||
ProductSeeder::class,
|
||||
PrintStockSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\PrintStock;
|
||||
use App\Models\Product;
|
||||
|
||||
class PrintStockSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$stocks = [
|
||||
[
|
||||
'name' => 'Standard Matte',
|
||||
'description' => 'Classic matte finish wallpaper. Professional appearance with subtle texture.',
|
||||
'cost_per_meter' => 8.50,
|
||||
'cost_per_m2' => 85.00,
|
||||
'type' => 'both'
|
||||
],
|
||||
[
|
||||
'name' => 'Premium Silk',
|
||||
'description' => 'Smooth silk finish with subtle sheen. Elegant and durable.',
|
||||
'cost_per_meter' => 12.50,
|
||||
'cost_per_m2' => 125.00,
|
||||
'type' => 'both'
|
||||
],
|
||||
[
|
||||
'name' => 'Luxury Velvet',
|
||||
'description' => 'Rich velvet texture with premium feel. High-end luxury option.',
|
||||
'cost_per_meter' => 16.00,
|
||||
'cost_per_m2' => 160.00,
|
||||
'type' => 'both'
|
||||
],
|
||||
[
|
||||
'name' => 'Canvas',
|
||||
'description' => 'Textured canvas finish. Great for artistic designs.',
|
||||
'cost_per_meter' => 14.00,
|
||||
'cost_per_m2' => 140.00,
|
||||
'type' => 'both'
|
||||
],
|
||||
[
|
||||
'name' => 'Glossy',
|
||||
'description' => 'Shiny glossy finish. Vibrant colors and easy to clean.',
|
||||
'cost_per_meter' => 10.00,
|
||||
'cost_per_m2' => 100.00,
|
||||
'type' => 'both'
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($stocks as $stock) {
|
||||
PrintStock::create($stock);
|
||||
}
|
||||
|
||||
// Attach all stocks to all products
|
||||
$products = Product::all();
|
||||
$stockIds = PrintStock::pluck('id')->toArray();
|
||||
|
||||
foreach ($products as $product) {
|
||||
$product->printStocks()->sync($stockIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Category;
|
||||
use App\Models\Product;
|
||||
|
||||
class ProductSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Create categories
|
||||
$categories = [
|
||||
[
|
||||
'name' => 'Botanical',
|
||||
'slug' => 'botanical',
|
||||
'description' => 'Organic prints featuring flora and nature-inspired designs.',
|
||||
'image' => 'https://images.unsplash.com/photo-1518895949257-7621c3c786d7?w=400&q=80'
|
||||
],
|
||||
[
|
||||
'name' => 'Vintage',
|
||||
'slug' => 'vintage',
|
||||
'description' => 'Timeless patterns with a nostalgic charm and elegance.',
|
||||
'image' => 'https://images.unsplash.com/photo-1631049307264-da0ec9d70304?w=500&q=80'
|
||||
],
|
||||
[
|
||||
'name' => 'Modern Murals',
|
||||
'slug' => 'modern-murals',
|
||||
'description' => 'Bold, statement-making designs for contemporary spaces.',
|
||||
'image' => 'https://images.unsplash.com/photo-1460661419201-fd4cecdf8a8b?w=400&q=80'
|
||||
],
|
||||
[
|
||||
'name' => 'Texture',
|
||||
'slug' => 'texture',
|
||||
'description' => 'Dimensional prints that add depth and tactile interest.',
|
||||
'image' => 'https://images.unsplash.com/photo-1578926078328-123alce3f3ce?w=400&q=80'
|
||||
],
|
||||
[
|
||||
'name' => 'Floral',
|
||||
'slug' => 'floral',
|
||||
'description' => 'Exquisite flower-based patterns in varied aesthetics.',
|
||||
'image' => 'https://images.unsplash.com/photo-1520763185298-1b434c919eba?w=400&q=80'
|
||||
],
|
||||
[
|
||||
'name' => 'Geometric',
|
||||
'slug' => 'geometric',
|
||||
'description' => 'Clean lines and striking forms for minimalist design.',
|
||||
'image' => 'https://images.unsplash.com/photo-1577720643272-265f434b3f6f?w=400&q=80'
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($categories as $category) {
|
||||
Category::create($category);
|
||||
}
|
||||
|
||||
// Create products
|
||||
$products = [
|
||||
// Botanical wallpapers
|
||||
[
|
||||
'category_id' => 1,
|
||||
'name' => 'Serenity Bloom',
|
||||
'slug' => 'serenity-bloom',
|
||||
'description' => 'Soft botanical watercolors perfect for bedroom spaces. Creates a peaceful, nature-inspired atmosphere.',
|
||||
'price' => 64.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1577720643272-265f434b3f6f?w=500&q=80',
|
||||
'stock' => 50,
|
||||
'featured' => true,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
[
|
||||
'category_id' => 1,
|
||||
'name' => 'Tropical Paradise',
|
||||
'slug' => 'tropical-paradise',
|
||||
'description' => 'Vibrant tropical foliage for adventurous interiors. Brings warmth and energy to any room.',
|
||||
'price' => 62.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1520763185298-1b434c919eba?w=500&q=80',
|
||||
'stock' => 45,
|
||||
'featured' => true,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
[
|
||||
'category_id' => 1,
|
||||
'name' => 'Coastal Breeze',
|
||||
'slug' => 'coastal-breeze',
|
||||
'description' => 'Serene seaside-inspired patterns in soft blues. Brings a refreshing, airy feel to spaces.',
|
||||
'price' => 61.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1505142468610-359e7d316be0?w=500&q=80',
|
||||
'stock' => 40,
|
||||
'featured' => false,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
[
|
||||
'category_id' => 1,
|
||||
'name' => 'Forest Canopy',
|
||||
'slug' => 'forest-canopy',
|
||||
'description' => 'Deep greens and natural textures inspired by forest landscapes.',
|
||||
'price' => 63.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1518895949257-7621c3c786d7?w=500&q=80',
|
||||
'stock' => 35,
|
||||
'featured' => false,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
|
||||
// Vintage wallpapers
|
||||
[
|
||||
'category_id' => 2,
|
||||
'name' => 'Heritage Gold',
|
||||
'slug' => 'heritage-gold',
|
||||
'description' => 'Ornamental pattern with metallic accents. Adds elegance and timeless sophistication.',
|
||||
'price' => 72.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1578500494198-246f612d03b3?w=500&q=80',
|
||||
'stock' => 30,
|
||||
'featured' => true,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
[
|
||||
'category_id' => 2,
|
||||
'name' => 'Antique Damask',
|
||||
'slug' => 'antique-damask',
|
||||
'description' => 'Classic damask pattern with vintage charm and luxury appeal.',
|
||||
'price' => 70.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1578500494198-246f612d03b3?w=500&q=80',
|
||||
'stock' => 28,
|
||||
'featured' => false,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
|
||||
// Modern Murals (per m²)
|
||||
[
|
||||
'category_id' => 3,
|
||||
'name' => 'Abstract Vision',
|
||||
'slug' => 'abstract-vision',
|
||||
'description' => 'Bold abstract designs perfect for making a statement in any space. Single non-repeating image.',
|
||||
'price' => 155.00,
|
||||
'image' => 'https://images.unsplash.com/photo-1460661419201-fd4cecdf8a8b?w=500&q=80',
|
||||
'stock' => 15,
|
||||
'featured' => true,
|
||||
'type' => 'mural'
|
||||
],
|
||||
[
|
||||
'category_id' => 3,
|
||||
'name' => 'Urban Sunset',
|
||||
'slug' => 'urban-sunset',
|
||||
'description' => 'Breathtaking cityscape at dusk. Perfect for modern living spaces and offices.',
|
||||
'price' => 168.00,
|
||||
'image' => 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=500&q=80',
|
||||
'stock' => 12,
|
||||
'featured' => true,
|
||||
'type' => 'mural'
|
||||
],
|
||||
[
|
||||
'category_id' => 3,
|
||||
'name' => 'Mountain Peak',
|
||||
'slug' => 'mountain-peak',
|
||||
'description' => 'Dramatic mountain landscape mural for inspiring spaces. Brings nature indoors.',
|
||||
'price' => 145.00,
|
||||
'image' => 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=500&q=80',
|
||||
'stock' => 10,
|
||||
'featured' => false,
|
||||
'type' => 'mural'
|
||||
],
|
||||
[
|
||||
'category_id' => 3,
|
||||
'name' => 'Ocean Waves',
|
||||
'slug' => 'ocean-waves',
|
||||
'description' => 'Serene ocean waves in calming blues. Perfect for creating peaceful environments.',
|
||||
'price' => 138.00,
|
||||
'image' => 'https://images.unsplash.com/photo-1505142468610-359e7d316be0?w=500&q=80',
|
||||
'stock' => 8,
|
||||
'featured' => false,
|
||||
'type' => 'mural'
|
||||
],
|
||||
|
||||
// Texture wallpapers
|
||||
[
|
||||
'category_id' => 4,
|
||||
'name' => 'Marble Dream',
|
||||
'slug' => 'marble-dream',
|
||||
'description' => 'Luxurious marble texture wallpaper for elegant spaces. Adds depth and sophistication.',
|
||||
'price' => 68.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1578926078328-123alce3f3ce?w=500&q=80',
|
||||
'stock' => 32,
|
||||
'featured' => true,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
[
|
||||
'category_id' => 4,
|
||||
'name' => 'Stone Elegance',
|
||||
'slug' => 'stone-elegance',
|
||||
'description' => 'Natural stone textures that create a sophisticated backdrop.',
|
||||
'price' => 66.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1578926078328-123alce3f3ce?w=500&q=80',
|
||||
'stock' => 29,
|
||||
'featured' => false,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
|
||||
// Floral wallpapers
|
||||
[
|
||||
'category_id' => 5,
|
||||
'name' => 'Crimson Velvet',
|
||||
'slug' => 'crimson-velvet',
|
||||
'description' => 'Luxe floral design in rich, deep tones. Creates a dramatic, sophisticated atmosphere.',
|
||||
'price' => 66.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1581092918056-0c4c3acd3789?w=500&q=80',
|
||||
'stock' => 27,
|
||||
'featured' => false,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
[
|
||||
'category_id' => 5,
|
||||
'name' => 'Rose Garden',
|
||||
'slug' => 'rose-garden',
|
||||
'description' => 'Delicate rose patterns perfect for romantic and elegant interiors.',
|
||||
'price' => 65.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1581092918056-0c4c3acd3789?w=500&q=80',
|
||||
'stock' => 24,
|
||||
'featured' => false,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
|
||||
// Geometric wallpapers
|
||||
[
|
||||
'category_id' => 6,
|
||||
'name' => 'Urban Grid',
|
||||
'slug' => 'urban-grid',
|
||||
'description' => 'Contemporary geometric pattern for modern interiors. Perfect for creating bold, structured spaces.',
|
||||
'price' => 59.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1557672172-298e090d0f80?w=500&q=80',
|
||||
'stock' => 38,
|
||||
'featured' => true,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
[
|
||||
'category_id' => 6,
|
||||
'name' => 'Minimalist Zen',
|
||||
'slug' => 'minimalist-zen',
|
||||
'description' => 'Clean, serene design with Japanese-inspired aesthetics. Perfect for creating calm spaces.',
|
||||
'price' => 55.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1511884642898-4c92249e20b6?w=500&q=80',
|
||||
'stock' => 42,
|
||||
'featured' => true,
|
||||
'type' => 'wallpaper'
|
||||
],
|
||||
[
|
||||
'category_id' => 6,
|
||||
'name' => 'Graphic Statements',
|
||||
'slug' => 'graphic-statements',
|
||||
'description' => 'Bold abstract graphics for contemporary spaces. Makes a powerful design statement.',
|
||||
'price' => 65.99,
|
||||
'image' => 'https://images.unsplash.com/photo-1577720643272-265f434b3f6f?w=500&q=80',
|
||||
'stock' => 33,
|
||||
'featured' => false,
|
||||
'type' => 'wallpaper'
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($products as $product) {
|
||||
Product::create($product);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user