added open_at for events

This commit is contained in:
2023-06-23 09:54:52 +10:00
parent 673f6051c1
commit 66e2a68cde
4 changed files with 31 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ class EventRequest extends BaseRequest
'end_at' => 'date|after:start_date',
'publish_at' => 'date|nullable',
'status' => [
Rule::in(['draft', 'soon', 'open', 'closed', 'cancelled']),
Rule::in(['draft', 'soon', 'open', 'closed', 'cancelled', 'scheduled']),
],
'registration_type' => [
Rule::in(['none', 'email', 'link', 'message']),

View File

@@ -33,6 +33,7 @@ class Event extends Model
'content',
'price',
'ages',
'open_at',
];

View File

@@ -0,0 +1,28 @@
<?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('events', function (Blueprint $table) {
$table->timestamp('open_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('events', function (Blueprint $table) {
$table->dropColumn('open_at');
});
}
};

View File

@@ -50,6 +50,7 @@
draft: 'Draft',
soon: 'Opening Soon',
open: 'Open',
scheduled: 'Scheduled',
closed: 'Closed',
cancelled: 'Cancelled',
}" />