database notification change table and body

hi guys, i want to change the table of filament notifications and change the data but couldn't find any resources can i apply this feature ?
10 Replies
Haydra
HaydraOP2w ago
@cheesegrits
Dan Mason
Dan Mason2w ago
What do you want to change? You can just edit the migration file for your project if its not changing the default columns in any major way.
Mohamed Ayaou
Mohamed Ayaou2w ago
Changing the default filament notifications will probably result in a tons of errors, but depending on how huge the changes are you might only have to change the table using migrations normaly and override the Filament\Notifications\etc classes in the AppServiceProvider e.g: SomeNotificationClass::configureUsing(fn (SomeNotificationClass $action) => $notifcation->something());
Haydra
HaydraOP2w ago
@Mohamed Ayaou actually the table has some changes, this is the table i want to use
CREATE TABLE `notifications` (
`id` int(11) NOT NULL,
`object_id` int(11) NOT NULL,
`object_type` tinyint(3) NOT NULL,
`seen_date` timestamp NULL DEFAULT NULL,
`seen` tinyint(1) NOT NULL COMMENT '2= Not seen | 3 = seen',
`clicks` int(3) NOT NULL DEFAULT 0 COMMENT 'Number of Clicks',
`user_role` tinyint(1) NOT NULL COMMENT '2= user | 3 = super admin |4=Assistant Manager | 5=Financial Manager\r\n|6=General Manager',
`user_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`created_by` int(11) NOT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `notifications` (
`id` int(11) NOT NULL,
`object_id` int(11) NOT NULL,
`object_type` tinyint(3) NOT NULL,
`seen_date` timestamp NULL DEFAULT NULL,
`seen` tinyint(1) NOT NULL COMMENT '2= Not seen | 3 = seen',
`clicks` int(3) NOT NULL DEFAULT 0 COMMENT 'Number of Clicks',
`user_role` tinyint(1) NOT NULL COMMENT '2= user | 3 = super admin |4=Assistant Manager | 5=Financial Manager\r\n|6=General Manager',
`user_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`created_by` int(11) NOT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
Mohamed Ayaou
Mohamed Ayaou2w ago
So, until you just add new columns then and not changing the default behavior you should be fine, just extend the Notifications classes with the needed methods as well as the views after pubishing them but you will face breaking changes issue
Haydra
HaydraOP2w ago
thank you, is there any resource i can use ? i'm trying to solve it, but i'm facing this issues @toeknee can you help me with it ?
toeknee
toeknee2w ago
@Haydra please refresh yourself with the #✅┊rules . Tagging is not permitted without consent.
Haydra
HaydraOP2w ago
sorry i forgot about this, because the issue is urgent
toeknee
toeknee2w ago
Whilst I appreciate that, its out of the scope of free support. People are helping for free.. I don't think you should be using the notifications table the way you are, and you should probably create your own table. Then notify the users there is a new X to review, which links to the resource and the actions needed.
Haydra
HaydraOP2w ago
yes indeed we all really appreciate the work you do for helping other developers thank you

Did you find this page helpful?