add guest invitation read & valide with route
This commit is contained in:
@@ -15,7 +15,7 @@ $factory->define(Event::class, function (Faker $faker) {
|
||||
'category_id' => factory(EventCategory::class),
|
||||
'name' => $faker->words(3, [false]),
|
||||
'description' => $faker->words(rand(10, 300), [false]),
|
||||
'private' => rand(0,1),
|
||||
'private' => !(rand(0,1)),
|
||||
'start_date' => $startDate,
|
||||
'end_date' => $endDate,
|
||||
'location' => $faker->city,
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateEventNonUserGuestsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('event_non_user_guests', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id');
|
||||
$table->string('email');
|
||||
$table->uuid('token')->default(\Illuminate\Support\Str::uuid());
|
||||
$table->timestamp('read_at')->nullable();
|
||||
$table->timestamp('validated_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('event_id')
|
||||
->references('id')
|
||||
->on('events')
|
||||
->onDelete('restrict')
|
||||
->onUpdate('restrict');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('event_non_user_guests', function (Blueprint $table) {
|
||||
$table->dropForeign(['event_id']);
|
||||
});
|
||||
|
||||
Schema::dropIfExists('event_non_user_guests');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user