id(); $table->string('title'); $table->text('description')->nullable(); $table->string('image_path')->nullable(); $table->string('thumb_path')->nullable(); $table->unsignedSmallInteger('image_width')->nullable(); $table->unsignedSmallInteger('image_height')->nullable(); $table->boolean('lent')->default(false)->index(); $table->string('location')->nullable(); $table->foreignId('lent_to_id')->nullable()->constrained('users')->nullOnDelete(); $table->date('lent_since')->nullable(); $table->date('lent_until')->nullable(); // Import aus dem WordPress-Verleihsystem: Beitrags-ID und Bildadresse (für „Bilder nachladen“) $table->unsignedBigInteger('wp_id')->nullable()->unique(); $table->string('wp_image_url', 1000)->nullable(); $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamps(); }); Schema::create('verleih_requests', function (Blueprint $table) { $table->id(); $table->foreignId('item_id')->constrained('verleih_items')->cascadeOnDelete(); $table->foreignId('user_id')->constrained('users')->cascadeOnDelete(); $table->string('location', 200); $table->date('from')->nullable(); $table->date('until')->nullable(); $table->text('message')->nullable(); $table->string('status', 16)->default('pending')->index(); // pending, accepted, declined, cancelled $table->foreignId('decided_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamp('decided_at')->nullable(); $table->string('note', 1000)->nullable(); $table->timestamps(); }); } public function down(): void { Schema::dropIfExists('verleih_requests'); Schema::dropIfExists('verleih_items'); } };