how to make the view link on Notifications show/trigger the modal and show the data through modal?
I have this Notification where after customer orders speicifc product from the customer-side it notifies the admin using notification , just like the notification on the demo-filament.php.
However I disabled the editing of the orders.
So what I want to achieve instead is to show the ordered data through modal using ViewAction?? is this possible?
btw im not using filament for customer-side, only on admin side
TIA 🙂
25 Replies
I think it would be better to redirect to a view page. I don’t think it’s good to leave them on the create page so they can’t try to creat the same record again.
ohh, my bad.
my description is wrong,
The notification part is from the admin,
User -> creates order -> notifies -> admin
I have updated it, sorry.
Right and normally they would get redirected to the edit page for the record since it’s already been created. I’m saying that you should just redirect them to a view page instead. No modal needed.
yeah but isnt that would confuse the admin if for instance there's 12 notifications in different time
and the admin decided to click/view oldest which then redirects him to Orders/viewpage it will make him filter the first just to what user's ordered.
but if what you're saying is i can modify the url so the table will be filtered automatically and show the data of the ordered item that came from notification.
I think that's good, if its possible
Is this a simple resource? I’m not following you.
sry idk what simple resource means.
ohh i get it now,
no.. it is not
I just removed the create module of my OrderResource for now
Ok. So, there’s no reason to send them back to a table view if you’re going to show them the record they created anyway. So just send them to a view page after it’s created instead of the edit page.
I’m mean they can only create one record at a time anyway.
ohh, sorry, i am not using filament for my customer's end
basically I just use filament for admin
its an small ecommerce app.
basically if customer creates an order I want to send notification to the admin-side which then will be seen on notifications modal and it will have a view link but since i disabled the
on the admin it will not be possible right? since view link returns /{record}/edit.
Is there any other way to view the specific order base on my scenario?
I'm only thinking using the view modal on the notification modal
so admin will be able to view the data right away even if the admin is on other page/s of the admin
im being too dumb on explaning lol, it should be customer not user, I kept saying user....
Hello SIr,
can i ask one more thing?
I dont know how to trigger or send a notification from customer-side to admin-side
do you have a link for this too?
as im only using filament on my admin side
Use notifications as normal, but setup database notifications. Then the based icon will show their count
Hello sir,
I am now able to send the data to database notifications
idk what's next, should I go and setup filament to receive the notification? if yes what should I do since the data came from customer-side?
If you setup database notifications the backend will have them in the icon clicking the icon will reveal it?
yes sir, i have setup that too.
I think im ready to get the data and show it to notification modal, dunno which step is next since im not using filament on my customer side.
just add ->sendToDatabase(auth()->user()) to the notification?
I assume you are using laravel for the custom side?
If so, just include the notifications package in the fucntion and send to database as per abvoe
im lost sir, all I know is ->sendToDatabase() is from filament but I dunno which function you're refering to.
this is how I send notification on my checkoutController
after order placed
it's being highlighted as "add method" sir
Method 'sendToDatabase' not found in void
should i just ignore it.
sorry about this, im complete new to it
Updated it
it's returning an undefined error sir
message: "Call to undefined method Illuminate\Notifications\Channels\MailChannel::sendToDatabase()"
Errr you are using Channels? Not Filament Notifications there.
how can I used the filament Notification sir? should i just extends it?
Please read the documentaiton for notifications
It's very simple.
is it this one sir?
\Filament\Notifications\Notification
Again please read the documentation:
https://filamentphp.com/docs/2.x/notifications/sending-notifications