dealhub/database/migrations/2026_01_12_085032_create_deals_table.php
kusowl f43f92f365 feat(Create deals): broker can create deals
- add deal category migration
- add deals migration and model
- add form to create deal
- add image preview modal when uploading the image
- refactor UI components to support `required` attribute
- refactor input component to support description
- fix some UI components does not support old values
- fix some UI components does not show error messages
2026-01-12 17:48:07 +05:30

38 lines
945 B
PHP

<?php
use App\Models\DealCategory;
use App\Models\User;
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('deals', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('slug');
$table->text('description');
$table->string('image')->nullable();
$table->string('link')->nullable();
$table->boolean('active')->default(false);
$table->foreignIdFor(DealCategory::class);
$table->foreignIdFor(User::class);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('deals');
}
};