From 66e2a68cde466789a32aed90f7df0f35a83ce509 Mon Sep 17 00:00:00 2001 From: James Collins Date: Fri, 23 Jun 2023 09:54:52 +1000 Subject: [PATCH] added open_at for events --- app/Http/Requests/EventRequest.php | 2 +- app/Models/Event.php | 1 + ...023_06_22_233236_add_open_at_to_events.php | 28 +++++++++++++++++++ resources/js/views/dashboard/EventEdit.vue | 1 + 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2023_06_22_233236_add_open_at_to_events.php diff --git a/app/Http/Requests/EventRequest.php b/app/Http/Requests/EventRequest.php index 5c152d1..88e83c9 100644 --- a/app/Http/Requests/EventRequest.php +++ b/app/Http/Requests/EventRequest.php @@ -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']), diff --git a/app/Models/Event.php b/app/Models/Event.php index 9d6d5a5..7f44314 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -33,6 +33,7 @@ class Event extends Model 'content', 'price', 'ages', + 'open_at', ]; diff --git a/database/migrations/2023_06_22_233236_add_open_at_to_events.php b/database/migrations/2023_06_22_233236_add_open_at_to_events.php new file mode 100644 index 0000000..9089877 --- /dev/null +++ b/database/migrations/2023_06_22_233236_add_open_at_to_events.php @@ -0,0 +1,28 @@ +timestamp('open_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('events', function (Blueprint $table) { + $table->dropColumn('open_at'); + }); + } +}; diff --git a/resources/js/views/dashboard/EventEdit.vue b/resources/js/views/dashboard/EventEdit.vue index 7a51853..ecacc17 100644 --- a/resources/js/views/dashboard/EventEdit.vue +++ b/resources/js/views/dashboard/EventEdit.vue @@ -50,6 +50,7 @@ draft: 'Draft', soon: 'Opening Soon', open: 'Open', + scheduled: 'Scheduled', closed: 'Closed', cancelled: 'Cancelled', }" />