Initial commit

This commit is contained in:
2026-10-31 13:24:24 +01:00
commit e6805f2245
87 changed files with 16180 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
*.sqlite*
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace Database\Factories;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends Factory<User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}
@@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('cache', function (Blueprint $table) {
$table->string('key')->primary();
$table->mediumText('value');
$table->bigInteger('expiration')->index();
});
Schema::create('cache_locks', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('owner');
$table->bigInteger('expiration')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};
@@ -0,0 +1,59 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('jobs', function (Blueprint $table) {
$table->id();
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedSmallInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
Schema::create('job_batches', function (Blueprint $table) {
$table->string('id')->primary();
$table->string('name');
$table->integer('total_jobs');
$table->integer('pending_jobs');
$table->integer('failed_jobs');
$table->longText('failed_job_ids');
$table->mediumText('options')->nullable();
$table->integer('cancelled_at')->nullable();
$table->integer('created_at');
$table->integer('finished_at')->nullable();
});
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->string('connection');
$table->string('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
$table->index(['connection', 'queue', 'failed_at']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
Schema::dropIfExists('job_batches');
Schema::dropIfExists('failed_jobs');
}
};
@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('categories', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->text('description')->nullable();
$table->string('icon')->default('box');
$table->boolean('is_featured')->default(false);
$table->integer('sort_order')->default(0);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('categories');
}
};
@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->foreignId('category_id')->nullable()->constrained()->nullOnDelete();
$table->string('name');
$table->string('slug')->unique();
$table->string('short_description', 500)->nullable();
$table->longText('description')->nullable();
$table->decimal('base_price', 8, 2);
$table->string('sku')->nullable();
$table->boolean('is_print_on_demand')->default(true);
$table->integer('stock')->default(10);
$table->boolean('is_featured')->default(false);
$table->boolean('is_active')->default(true);
$table->string('dimensions')->nullable(); // bijv. "12 x 8 x 15 cm"
$table->integer('weight_grams')->nullable(); // bijv. 85
$table->decimal('print_time_hours', 4, 1)->nullable(); // bijv. 4.5
$table->string('image_url')->nullable();
$table->json('gallery_images')->nullable();
$table->json('available_materials')->nullable(); // ["pla", "petg", "tpu"]
$table->json('available_colors')->nullable(); // ["Mat Zwart", "Sneeuwwit", ...]
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('products');
}
};
@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('materials', function (Blueprint $table) {
$table->id();
$table->string('name'); // bv. PLA+, PETG, TPU Flex, ABS
$table->string('code')->unique(); // pla, petg, tpu
$table->text('description')->nullable();
$table->string('badge_color')->default('emerald'); // emerald, blue, purple, amber
$table->decimal('price_multiplier', 4, 2)->default(1.00); // bv. 1.00, 1.25, 1.40
$table->boolean('is_active')->default(true);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('materials');
}
};
@@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('colors', function (Blueprint $table) {
$table->id();
$table->string('name'); // Mat Zwart, Sneeuwwit, Signaal Oranje, etc.
$table->string('hex'); // #111827, #FFFFFF, etc.
$table->boolean('in_stock')->default(true);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('colors');
}
};
@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('orders', function (Blueprint $table) {
$table->id();
$table->string('order_number')->unique(); // J3D-2026-0001
$table->string('customer_name');
$table->string('customer_email');
$table->string('customer_phone')->nullable();
$table->string('shipping_street');
$table->string('shipping_number');
$table->string('shipping_postal_code');
$table->string('shipping_city');
$table->string('shipping_country')->default('Nederland');
$table->text('notes')->nullable();
$table->string('status')->default('in_behandeling'); // in_behandeling, in_print, afgerond, verzonden, geannuleerd
$table->decimal('subtotal', 8, 2);
$table->decimal('shipping_cost', 8, 2)->default(4.95);
$table->decimal('total', 8, 2);
$table->string('payment_status')->default('in_afwachting'); // in_afwachting, betaald, geannuleerd
$table->string('payment_method')->default('ideal');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('orders');
}
};
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('order_items', function (Blueprint $table) {
$table->id();
$table->foreignId('order_id')->constrained()->cascadeOnDelete();
$table->foreignId('product_id')->nullable()->constrained()->nullOnDelete();
$table->string('product_name');
$table->string('material')->nullable(); // PLA+, PETG, etc.
$table->string('color')->nullable(); // Mat Zwart
$table->string('scale')->default('100%'); // 100%, 150%, etc.
$table->string('infill')->default('Standaard (20%)');
$table->integer('quantity')->default(1);
$table->decimal('unit_price', 8, 2);
$table->decimal('total_price', 8, 2);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('order_items');
}
};
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('custom_requests', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email');
$table->string('phone')->nullable();
$table->text('description');
$table->string('file_path')->nullable(); // Uploaded .stl, .step, .obj
$table->string('original_filename')->nullable();
$table->string('preferred_material')->nullable();
$table->string('preferred_color')->nullable();
$table->string('dimensions')->nullable();
$table->string('status')->default('nieuw'); // nieuw, offerte_verstuurd, in_behandeling, afgerond
$table->decimal('quoted_price', 8, 2)->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('custom_requests');
}
};
+217
View File
@@ -0,0 +1,217 @@
<?php
namespace Database\Seeders;
use App\Models\Category;
use App\Models\Color;
use App\Models\Material;
use App\Models\Product;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
public function run(): void
{
// 1. Materialen
$materials = [
[
'name' => 'PLA+ Premium',
'code' => 'pla',
'description' => 'Milieuvriendelijk, vormvast en strakke printlagen. Dé universele keuze voor interieur, houders en decoratie.',
'badge_color' => 'emerald',
'price_multiplier' => 1.00,
],
[
'name' => 'PETG Tough',
'code' => 'petg',
'description' => 'Hittebestendig tot 75°C, slagvast en waterbestendig. Ideaal voor zwaarder belaste gereedschappen en buitentoepassingen.',
'badge_color' => 'blue',
'price_multiplier' => 1.20,
],
[
'name' => 'TPU 95A Flexibel',
'code' => 'tpu',
'description' => 'Rubberachtig elastomeer. Schokabsorberend, slijtvast en nagenoeg onverwoestbaar.',
'badge_color' => 'amber',
'price_multiplier' => 1.35,
],
[
'name' => 'Resin Ultra-Detail',
'code' => 'resin',
'description' => 'Vloeibare fotopolymeer hars voor spuitgietkwaliteit met microscopische laaglijnen en perfecte details.',
'badge_color' => 'purple',
'price_multiplier' => 1.50,
],
];
foreach ($materials as $m) {
Material::updateOrCreate(['code' => $m['code']], $m);
}
// 2. Kleuren
$colors = [
['name' => 'Mat Zwart', 'hex' => '#171717', 'in_stock' => true],
['name' => 'Sneeuwwit', 'hex' => '#F8FAFC', 'in_stock' => true],
['name' => 'Galaxy Grijs', 'hex' => '#475569', 'in_stock' => true],
['name' => 'Signaal Oranje', 'hex' => '#EA580C', 'in_stock' => true],
['name' => 'Bamboe Groen', 'hex' => '#16A34A', 'in_stock' => true],
['name' => 'Kobaltblauw', 'hex' => '#2563EB', 'in_stock' => true],
['name' => 'Koper Zijdeglans', 'hex' => '#B45309', 'in_stock' => true],
['name' => 'Vurig Rood', 'hex' => '#DC2626', 'in_stock' => true],
];
foreach ($colors as $c) {
Color::updateOrCreate(['name' => $c['name']], $c);
}
// 3. Categorieën
$catInterieur = Category::updateOrCreate(['slug' => 'home-interieur'], [
'name' => 'Home & Interieur',
'slug' => 'home-interieur',
'description' => 'Stijlvolle geometrische vazen, wanddecoratie en functioneel design voor in huis.',
'icon' => 'home',
'is_featured' => true,
'sort_order' => 1,
]);
$catBureau = Category::updateOrCreate(['slug' => 'bureau-tech'], [
'name' => 'Bureau & Tech Accessoires',
'slug' => 'bureau-tech',
'description' => 'Organizers, telefoonstandaarden, hoofdtelefoonhouders en kabelmanagement.',
'icon' => 'laptop',
'is_featured' => true,
'sort_order' => 2,
]);
$catTools = Category::updateOrCreate(['slug' => 'gereedschap-werkplaats'], [
'name' => 'Gereedschap & Werkplaats',
'slug' => 'gereedschap-werkplaats',
'description' => 'Robuuste houders, borensets, meetgereedschap en handige garage-hulpstukken.',
'icon' => 'wrench',
'is_featured' => false,
'sort_order' => 3,
]);
$catGadgets = Category::updateOrCreate(['slug' => 'gadgets-speelgoed'], [
'name' => 'Gadgets & Speelgoed',
'slug' => 'gadgets-speelgoed',
'description' => 'Articulated beweegbare figuren, fidget gadgets en unieke giveaways.',
'icon' => 'sparkles',
'is_featured' => true,
'sort_order' => 4,
]);
$catCustom = Category::updateOrCreate(['slug' => 'custom-printservice'], [
'name' => 'Custom Printservice',
'slug' => 'custom-printservice',
'description' => 'Laat jouw eigen STL- of CAD-ontwerp professioneel printen op maat.',
'icon' => 'printer',
'is_featured' => true,
'sort_order' => 5,
]);
// 4. Producten
$products = [
[
'category_id' => $catInterieur->id,
'name' => 'Origami Geometrische Vaas',
'slug' => 'origami-geometrische-vaas',
'short_description' => 'Moderne vaas met scherpe facetten en minimalistische vouwlijnen. Een eyecatcher op elke tafel.',
'description' => "De Origami Vaas combineert traditionele vouwkunst met hypermoderne additieve fabricage. Geprint in spiralize vaasmodus of met versterkte wanden voor een 100% waterdichte afwerking bij keuze voor PETG. Ideaal voor droogbloemen of als sculptuur in je woonkamer.",
'base_price' => 18.95,
'sku' => 'J3D-VAS-001',
'is_featured' => true,
'dimensions' => '11 x 11 x 22 cm',
'weight_grams' => 140,
'print_time_hours' => 5.5,
'image_url' => 'https://images.unsplash.com/photo-1578749556568-bc2c40e68b61?auto=format&fit=crop&w=800&q=80',
'available_materials' => ['pla', 'petg'],
'available_colors' => ['Mat Zwart', 'Sneeuwwit', 'Galaxy Grijs', 'Koper Zijdeglans'],
],
[
'category_id' => $catBureau->id,
'name' => 'Ergonomische MagSafe Telefoon- & Watchhouder',
'slug' => 'ergonomische-magsafe-telefoonhouder',
'short_description' => 'Strakke bureau-standaard met kabelgoot, geschikt voor iPhone MagSafe en smartwatch.',
'description' => "Houd je bureau opgeruimd en je smartphone in de perfecte 65-graden kijkhoek voor videocalls of StandBy-modus. Voorzien van antislip voetpads en een slimme verborgen kabelgoot.",
'base_price' => 14.50,
'sku' => 'J3D-DSK-002',
'is_featured' => true,
'dimensions' => '9 x 8 x 12 cm',
'weight_grams' => 95,
'print_time_hours' => 3.5,
'image_url' => 'https://images.unsplash.com/photo-1586105251261-72a756497a11?auto=format&fit=crop&w=800&q=80',
'available_materials' => ['pla', 'petg'],
'available_colors' => ['Mat Zwart', 'Sneeuwwit', 'Galaxy Grijs'],
],
[
'category_id' => $catBureau->id,
'name' => 'Minimal Hoofdtelefoon Bureaustandaard',
'slug' => 'minimal-hoofdtelefoon-standaard',
'short_description' => 'Elegante boogstandaard om je headset veilig en vormvast op te bergen.',
'description' => "Geen rondslingerende hoofdtelefoons meer. Het brede steunvlak ontziet de hoofdband en voorkomt drukplekken in de kussens. Geprint met versterkte infill voor optimale stabiliteit.",
'base_price' => 22.50,
'sku' => 'J3D-DSK-003',
'is_featured' => true,
'dimensions' => '14 x 12 x 26 cm',
'weight_grams' => 210,
'print_time_hours' => 8.0,
'image_url' => 'https://images.unsplash.com/photo-1546435770-a3e426bf472b?auto=format&fit=crop&w=800&q=80',
'available_materials' => ['pla', 'petg'],
'available_colors' => ['Mat Zwart', 'Galaxy Grijs', 'Sneeuwwit'],
],
[
'category_id' => $catGadgets->id,
'name' => 'Articulated Flexibele Kristaldraak',
'slug' => 'articulated-flexibele-kristaldraak',
'short_description' => 'Print-in-place scharnierende draak met tientallen soepele schakels. Fascinerend fidget & decoratie-item.',
'description' => "In één stuk geprint zonder montage of schroeven! De schakels bewegen soepel en natuurlijk in je handen. Verkrijgbaar in zijdeglans en tweekleurige effecten.",
'base_price' => 19.95,
'sku' => 'J3D-GAD-004',
'is_featured' => true,
'dimensions' => '45 x 6 x 4 cm',
'weight_grams' => 120,
'print_time_hours' => 6.0,
'image_url' => 'https://images.unsplash.com/photo-1563089145-599997674d42?auto=format&fit=crop&w=800&q=80',
'available_materials' => ['pla'],
'available_colors' => ['Koper Zijdeglans', 'Signaal Oranje', 'Bamboe Groen', 'Mat Zwart'],
],
[
'category_id' => $catInterieur->id,
'name' => 'Hexagon Modulaire Wandplankjes (Set van 3)',
'slug' => 'hexagon-modulaire-wandplankjes',
'short_description' => 'Honingraat wanddisplay voor kleine plantjes, miniaturen of edelstenen. Inclusief onzichtbare wandmontage.',
'description' => "Creëer je eigen geometrische wandpatroon. Eenvoudig op te hangen met dubbelzijdige montagepads of kleine spijkers. Robuust ontworpen om kleine vetplantjes en beeldjes moeiteloos te dragen.",
'base_price' => 27.50,
'sku' => 'J3D-HOM-005',
'is_featured' => false,
'dimensions' => '15 x 13 x 6 cm (per stuk)',
'weight_grams' => 260,
'print_time_hours' => 9.5,
'image_url' => 'https://images.unsplash.com/photo-1513519245088-0e12902e5a38?auto=format&fit=crop&w=800&q=80',
'available_materials' => ['pla', 'petg'],
'available_colors' => ['Mat Zwart', 'Sneeuwwit', 'Koper Zijdeglans'],
],
[
'category_id' => $catTools->id,
'name' => 'Heavy-Duty Boorkophouder & Magnetische Bit Tray',
'slug' => 'heavy-duty-boorkophouder-bit-tray',
'short_description' => 'Georganiseerde opberger voor 1/4" hex bits en boorkoppen met krachtige Neodymium magneten.',
'description' => "Geprint in taai en chemicaliënbestendig PETG. Nooit meer losse schroefbits zoeken in je gereedschapskist. De magnetische bodem houdt al je metalen accessoires stevig op hun plek.",
'base_price' => 16.95,
'sku' => 'J3D-WRK-006',
'is_featured' => false,
'dimensions' => '16 x 7 x 3.5 cm',
'weight_grams' => 110,
'print_time_hours' => 4.0,
'image_url' => 'https://images.unsplash.com/photo-1581783898377-1c85bf937427?auto=format&fit=crop&w=800&q=80',
'available_materials' => ['petg', 'tpu'],
'available_colors' => ['Mat Zwart', 'Signaal Oranje', 'Kobaltblauw'],
],
];
foreach ($products as $p) {
Product::updateOrCreate(['slug' => $p['slug']], $p);
}
}
}