- add schema and endpoints to make follows relationship with customer and broker - show and update states of follow button on ui
26 lines
589 B
PHP
26 lines
589 B
PHP
<?php
|
|
|
|
use App\Models\Broker;
|
|
use App\Models\Customer;
|
|
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('follows', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignIdFor(Customer::class);
|
|
$table->foreignIdFor(Broker::class);
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('follows');
|
|
}
|
|
};
|