Create routes and views for customers and their addresses.
This commit is contained in:
@@ -12,7 +12,7 @@ return new class extends Migration {
|
||||
{
|
||||
Schema::create('addresses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained();
|
||||
$table->foreignId('customer_id')->constrained();
|
||||
|
||||
$table->string('name');
|
||||
$table->string('email')->nullable();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
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::table('addresses', function (Blueprint $table) {
|
||||
$table->boolean('is_address')->default(false)->after('customer_id');
|
||||
$table->boolean('is_delivery')->default(false)->after('is_address');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('addresses', function (Blueprint $table) {
|
||||
$table->dropColumn('is_address');
|
||||
$table->dropColumn('is_delivery');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user