added event ages
This commit is contained in:
@@ -28,7 +28,8 @@ class Event extends Model
|
||||
'registration_data',
|
||||
'hero',
|
||||
'content',
|
||||
'price'
|
||||
'price',
|
||||
'ages',
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->string('ages')->default("");
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->dropColumn('ages');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -12,6 +12,7 @@ export interface Event {
|
||||
registration_type: string;
|
||||
registration_data: string;
|
||||
price: string;
|
||||
ages: string;
|
||||
}
|
||||
|
||||
export interface EventResponse {
|
||||
|
||||
@@ -90,6 +90,13 @@
|
||||
<div v-if="event.price" class="sm-workshop-price">
|
||||
<h4><span class="icon">$</span>{{ computedPrice }}</h4>
|
||||
</div>
|
||||
<div v-if="event.ages" class="sm-workshop-ages">
|
||||
<h4>
|
||||
<ion-icon class="icon" name="body-outline" />{{
|
||||
event.ages
|
||||
}}
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</SMContainer>
|
||||
</SMContainer>
|
||||
|
||||
@@ -68,6 +68,13 @@
|
||||
>Leave blank to hide from public.</SMInput
|
||||
>
|
||||
</SMColumn>
|
||||
<SMColumn>
|
||||
<SMInput control="ages"
|
||||
>Leave blank to hide from public.</SMInput
|
||||
>
|
||||
</SMColumn>
|
||||
</SMRow>
|
||||
<SMRow>
|
||||
<SMColumn>
|
||||
<SMInput
|
||||
type="select"
|
||||
@@ -79,8 +86,6 @@
|
||||
link: 'Link',
|
||||
}" />
|
||||
</SMColumn>
|
||||
</SMRow>
|
||||
<SMRow>
|
||||
<SMColumn>
|
||||
<SMInput
|
||||
v-if="registration_data?.visible"
|
||||
@@ -239,6 +244,7 @@ const form = reactive(
|
||||
hero: FormControl("", Required()),
|
||||
content: FormControl(),
|
||||
price: FormControl(),
|
||||
ages: FormControl(),
|
||||
})
|
||||
);
|
||||
|
||||
@@ -284,6 +290,7 @@ const loadData = async () => {
|
||||
: "";
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user