diff --git a/app/Http/Controllers/Studio/PriceRequestController.php b/app/Http/Controllers/Studio/PriceRequestController.php new file mode 100644 index 0000000..1a86d9b --- /dev/null +++ b/app/Http/Controllers/Studio/PriceRequestController.php @@ -0,0 +1,16 @@ +update(['approved_at' => now()]); + + return redirect()->route('studio.dashboard.overview'); + } +} diff --git a/app/Models/PriceRequest.php b/app/Models/PriceRequest.php new file mode 100644 index 0000000..7929bf7 --- /dev/null +++ b/app/Models/PriceRequest.php @@ -0,0 +1,20 @@ +belongsTo(User::class); + } +} diff --git a/app/Models/User.php b/app/Models/User.php index 1841d5a..942e10e 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -96,4 +96,9 @@ public function payments(): HasMany { return $this->hasMany(Payment::class); } + + public function priceRequests(): HasMany + { + return $this->hasMany(PriceRequest::class); + } } diff --git a/database/migrations/2025_10_29_013939_create_price_requests_table.php b/database/migrations/2025_10_29_013939_create_price_requests_table.php new file mode 100644 index 0000000..b6bea08 --- /dev/null +++ b/database/migrations/2025_10_29_013939_create_price_requests_table.php @@ -0,0 +1,34 @@ +id(); + $table->foreignId('user_id')->constrained()->cascadeOnDelete(); + $table->string('model', 20); + $table->string('signature')->unique()->nullable(); + $table->timestamp('last_requested_at')->nullable(); + $table->timestamp('expires_at')->nullable(); + $table->timestamp('approved_at')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('price_requests'); + } +};