Conversation
There was a problem hiding this comment.
Pull request overview
Introduces frontend wiring for an Announcements banner and adjusts the database seeder to avoid creating duplicate default announcements on repeated seed runs.
Changes:
- Registers
AnnouncementBannerglobally during module setup viaregisterGlobalComponent. - Removes the prior App.vue patch mechanism intended to inject the banner into the root template.
- Updates
AnnouncementsDatabaseSeederto only create the default announcement when the table is empty.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| resources/js/app.ts | Registers the announcement banner globally during module setup. |
| patches/app-vue.patch | Removes the patch that previously injected AnnouncementBanner into the host App.vue. |
| database/seeders/AnnouncementsDatabaseSeeder.php | Prevents duplicate default announcements by creating only when no announcements exist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| */ | ||
| export function setup() { | ||
| console.debug('Announcements module loaded'); | ||
| registerGlobalComponent('top', AnnouncementBanner); |
There was a problem hiding this comment.
PR description mentions adding to the root App.vue template, but this PR removes the App.vue patch and only registers the component via registerGlobalComponent('top', ...). Unless the host app actually renders the registered top slot/region, the banner may no longer appear. Please either (a) update the PR description to match the new integration approach, or (b) ensure there is a concrete render point in the host/root layout for this global component registration path.
This pull request introduces the Announcements module to the application, focusing on displaying a global announcement banner and updating the database seeder logic to prevent duplicate announcements. The main changes are grouped below:
Frontend Integration
AnnouncementBannercomponent globally at the top of the app using the newregisterGlobalComponentutility inapp.ts, ensuring the banner is available across all pages.AnnouncementBannercomponent to the rootApp.vuetemplate so that announcements are always visible to users.Backend/Data Seeding
AnnouncementsDatabaseSeederso that it only creates the default announcement if none exist, preventing duplicate records on repeated seed runs.