parent
77299944de
commit
7178c37eba
8 changed files with 151 additions and 14 deletions
@ -0,0 +1,15 @@ |
||||
<?php |
||||
|
||||
namespace App\Models; |
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||
use Illuminate\Database\Eloquent\Model; |
||||
|
||||
class AppointmentBookingDetail extends Model |
||||
{ |
||||
use HasFactory; |
||||
|
||||
public function appointment(){ |
||||
return $this->belongsTo(Appointment::class); |
||||
} |
||||
} |
@ -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 |
||||
{ |
||||
/** |
||||
* Run the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function up() |
||||
{ |
||||
Schema::table('appointments', function (Blueprint $table) { |
||||
$table->boolean('is_booked')->default(false); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* Reverse the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function down() |
||||
{ |
||||
Schema::table('appointments', function (Blueprint $table) { |
||||
// |
||||
}); |
||||
} |
||||
}; |
@ -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 |
||||
{ |
||||
/** |
||||
* Run the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function up() |
||||
{ |
||||
Schema::create('appointment_booking_details', function (Blueprint $table) { |
||||
$table->id(); |
||||
$table->bigInteger('appointment_id')->unsigned(); |
||||
$table->foreign('appointment_id')->references('id')->on('appointments')->onDelete('cascade'); |
||||
$table->string('name'); |
||||
$table->string('email')->nullable(); |
||||
$table->string('phone'); |
||||
$table->string('notes')->nullable(); |
||||
$table->timestamps(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* Reverse the migrations. |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function down() |
||||
{ |
||||
Schema::dropIfExists('appointment_booking_details'); |
||||
} |
||||
}; |
Loading…
Reference in new issue