Laravel Filament: Separate Dashboard for User Roles?
Вставка
- Опубліковано 20 бер 2023
- I'm answering a question about Filament: how to customize the dashboard widgets per different user roles.
Full course "Laravel Filament Admin: Practical Course": laraveldaily.com/course/filam...
- - - - -
Support the channel by checking out my products:
- My Laravel courses: laraveldaily.com/courses
- Laravel QuickAdminPanel: quickadminpanel.com
- Livewire Kit Components: livewirekit.com
- - - - -
Other places to follow:
- My weekly Laravel newsletter: us11.campaign-archive.com/hom...
- My personal Twitter: / povilaskorop - Навчання та стиль
From what I’ve seen online, Filament is far better than nova. We made the mistake of using Nova as an admin panel for big clients. It starts to fall apart when you have complex relationships and column types. Looks like with filament solves some of that.
Yeah I've read plenty of forums where everyone who has switched to Filament from Nova were extremely happy they did
Thank you for your videos. Based on the documentation, you can use Laravel policies to manage this. You can also utilize scopes to restrict user access to different sections of the dashboard.
i am your biggest fan sir if i got any problem i saw your videos for solution thank you for solving all my problems
Thank you sir ❤❤❤
didn't dig in the code, but i hope that "canView" method will not fire the "getCards" in order to avoid querying the database, not just a visibility option. Anyway another great video, thanks!
How do i prevent an ordinary user from logging into admin dashboard?
Thank you
Great video, Thanks! I have a question, is it possible to create a laravel project where we will have one administrator and for example 1000 users who will use the same application but each user has his own database. I started to read doc Tenancy for Laravel but I think that is big challenge for laravel? Could you please give me some advice, and what do you think about that?
Thanks
i am wonder if i can filter table by user id. for example i need user id = 3 show only postes created by user id = 3 ?
How can i implement canView() function if i am using spatie laravel permission?
Alongside Livewire/fillament , inertia vue is popular, If you create an video about create different dashboard using laravel, vue inertia js would be great. thanks
Good morning. Can you please share the repository for the project2 sample you mention in the video? I did a search online but cant find it. Thanks For your help
I don't have a repository, it was just an experiment project
I learnt to use filament a month ago,
I Have a doubt
How can we implement breeze auth with filament admin auth
as in There's a field named 'is_admin' in the user model now if the user is 'is_admin' only then the user can acess '/admin' of filament else he cannot access the filament panel routes.
You then have two route pages: regular Laravel routes, and then in Filament you implement User model method canAccessPanel() with return is_admin true
i am currently working on a project with filament and one issue that faced me was trying to validate a combination of two columns
$table->unique(['user_id', 'year_id'])
how to do that in filament ?
i did it in a mutateStateBeforeSave() and if it's not unique i send back a notification
but i think it's not a best practice is there is cleaner way or something i am missing 🤔
I think it's ok practice, I would probably do the same. Or custom validation rule. Maybe ask on their github/discord, maybe they have something?
How to show or preview pdf file ?
Can i use filament for frontend pages outside of the dashboard ? if so how
Filament is for admin area. Not sure WHY you would need to use it for front-end area.
@@LaravelDaily just to have the same design on admin panel and frontend pages but it's not a big deal i can try to mimic the style with tailwindcss
I wonder how we can do this in Filament 3 with the new multiple panels setup
I have this video about it: ua-cam.com/video/gJacrxk7v4E/v-deo.html
In build packages are really great. But when comes unaccepted requirements then it's so difficult to solve them
just finished your course about filament. i have a question. how to create custom page? like 1 page only for "setting". only for change the website title, phone number, or email. tried to read the doc, but still confusing
What's confusing? It's just a livewire component
@@krekas where i should put the livewire code? in app/filament/page ?
@Asov 3x where else would you put it? Sorry, but it's a weird question. Also, better try, if getting errors go to official filament discord and ask question, show the code with error.
would going for multi-tenancy to achieve this for say 1000 users be an overkill?
You never know until you try
@@LaravelDaily Agreed will put that to test
I want to disabled the default widget dashboard of filament. I have seen documentation but it's not working. What to do please suggest?
What exactly have you done that is not working? All you need is empty the widgets() array in panel provider.
@@LaravelDaily thanks
hello sir , can you please make us a video about laravel 10 and php voyager ? I need to know asap is it doable because it didn't work with me and thank you
I don't use voyager, sorry
@@LaravelDailyshould i use filament instead ?
All tools are good if you know how to use them. So it's a personal preference.
@@LaravelDaily thank you very much !! Well appreciated
Hello, I have a question, I hope you can help me:
How can I present only the data associated with the user?
For example, if a user belongs to a department, only records related to the department to which the user belongs will appear.
Hard to answer in a UA-cam comment, without specifically trying where ans what you want to present that data.
@@LaravelDaily I'm sorry I don't explain this well using a Filament Resource in which a table with data is shown, and the options to create, edit, delete.
What I want to do is that when a user logs in the table only loads those records that the user has created.
You can use Global Scopes for this: filamentphp.com/docs/3.x/panels/tenancy#simple-one-to-many-tenancy
@@LaravelDaily Thank you so much
Is this doable for resources, or it has to be a widget?
Thank you
In Filament, it is now done by multiple panels.
I'm using V2, does that make a difference?@@LaravelDaily
Yes v2 is totally different for that case.
Return null 😂 Robert Martin is 😮😮😮
It’s like you read my mind some days. I was thinking about how to do this exact thing as I went to bed then in the morning you deliver! 🫶
With 120k subscribers and daily videos, there's a chance I will hit something like that sometimes :)
@@LaravelDaily You do it all the time for me, thank you!
Hello mister. How can i upload video with filament ? 😢
I don't think filament has a specific video field. How is it different from general file upload?
@@LaravelDaily i don’t say it defferent but when i upload file after loading it failed automaticaly. And i can’t use imageColumn to show video what i have in my database. FileColumn not exist Also.
Sorry for my english. I’m frensh speaker 😁
@@LaravelDaily can you Make a tutorial for this part please
I want to use it on my fitness app
I think I need to create a tutorial about video file uploads in general, yes. But can do it only in a few weeks.
in V3 we can have many panels 🤫🤫
Yes, video about exactly that is coming in a few days.
@@LaravelDaily Cant wait for that 🔥
I have multiple dashboards without using filament or anything, I just use roles. @role("admin") in views.
@extends('layouts.app-master-backend')
@role("firma")
@include('dashboards.firma')
@endrole
@role("cv")
@include('dashboards.kandidat')
@endrole
@role("admin")
@include('dashboards.admin')
@endrole
@role("editor")
@include('dashboards.editor')
@endrole