Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Stockholm's avatar

Adding fields to the Announcement form

Hi, I need help with customisation of the Announcement form. on the page: */spark/kiosk#/announcements

I managed to add the fields to the form and I changed the controller but the data is not saved to db and no errors are returned in the form. Please advice where else to alter code to get this to work.

Did this:

in: "create_announcements_table.php" added:

$table->string('label')->nullable(); $table->string('label_color')->nullable();

tried php artisan migrate but got the msg, nothing to migrate so I added the columns manually to the db table.

in "AnnouncementsController.php" added rows to the store() and update() functions

'label' => 'required_with:label_color|max:255', 'label_color' => 'required_with:label|max:255',

in "announcements.blade.php" added:

                <div class="form-group row" :class="{'is-invalid': createForm.errors.has('label')}">
                    <label class="col-md-4 col-form-label text-md-right">{{__('Label')}}</label>

                    <div class="col-md-6">
                        <input type="text" class="form-control" name="label" v-model="createForm.label">

                        <span class="invalid-feedback" v-show="createForm.errors.has('label')">
                            @{{ createForm.errors.get('label') }}
                        </span>
                    </div>
                </div>

               
                <div class="form-group row" :class="{'is-invalid': createForm.errors.has('label_color')}">
                    <label class="col-md-4 col-form-label text-md-right">{{__('Label Color')}}</label>

                    <div class="col-md-6">
                        <input type="text" class="form-control" name="label_color" v-model="createForm.label_color">

                        <span class="invalid-feedback" v-show="createForm.errors.has('label_color')">
                            @{{ createForm.errors.get('label_color') }}
                        </span>
                    </div>
                </div>

0 likes
2 replies
Stockholm's avatar
Stockholm
OP
Best Answer
Level 10

I finally got it to work. PLEASE - can anyone advise on how to do this a better way? So I can upgrade Stripe ...

Summary of all files that I had to change:

migration: create_announcements_table.php spark/src/Http/Controllers/Kiosk/AnnouncementsController.php resources/views/vendor/spark/kiosk/announcements.blade.php spark/src/Repositories/AnnouncementRepository.php spark/resources/assets/js/kiosk/announcements.js

Please or to participate in this conversation.