diff --git a/app/Models/Event.php b/app/Models/Event.php index 071a834..3924235 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -28,7 +28,8 @@ class Event extends Model 'registration_data', 'hero', 'content', - 'price' + 'price', + 'ages', ]; diff --git a/database/migrations/2023_03_01_075334_add_ages_to_events_table.php b/database/migrations/2023_03_01_075334_add_ages_to_events_table.php new file mode 100644 index 0000000..b3543fb --- /dev/null +++ b/database/migrations/2023_03_01_075334_add_ages_to_events_table.php @@ -0,0 +1,32 @@ +string('ages')->default(""); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('events', function (Blueprint $table) { + $table->dropColumn('ages'); + }); + } +}; diff --git a/resources/js/helpers/api.types.ts b/resources/js/helpers/api.types.ts index a8341ff..c5af22e 100644 --- a/resources/js/helpers/api.types.ts +++ b/resources/js/helpers/api.types.ts @@ -12,6 +12,7 @@ export interface Event { registration_type: string; registration_data: string; price: string; + ages: string; } export interface EventResponse { diff --git a/resources/js/views/EventView.vue b/resources/js/views/EventView.vue index ef5c231..77f3691 100644 --- a/resources/js/views/EventView.vue +++ b/resources/js/views/EventView.vue @@ -90,6 +90,13 @@

${{ computedPrice }}

+
+

+ {{ + event.ages + }} +

+
diff --git a/resources/js/views/dashboard/EventEdit.vue b/resources/js/views/dashboard/EventEdit.vue index a44f2ee..82e5b6d 100644 --- a/resources/js/views/dashboard/EventEdit.vue +++ b/resources/js/views/dashboard/EventEdit.vue @@ -68,6 +68,13 @@ >Leave blank to hide from public. + + Leave blank to hide from public. + + + - - { : ""; form.controls.hero.value = data.event.hero; form.controls.price.value = data.event.price; + form.controls.ages.value = data.event.ages; } catch (err) { pageError.value = err.response.status; } finally { @@ -316,6 +323,7 @@ const handleSubmit = async () => { content: form.controls.content.value, hero: form.controls.hero.value, price: form.controls.price.value, + ages: form.controls.ages.value, }; if (route.params.id) {