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
  • Навчання та стиль

КОМЕНТАРІ • 63

  • @wadecodez
    @wadecodez Рік тому +9

    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.

    • @JamesAutoDude
      @JamesAutoDude 11 місяців тому +1

      Yeah I've read plenty of forums where everyone who has switched to Filament from Nova were extremely happy they did

  • @KiaBoluki
    @KiaBoluki 10 місяців тому +1

    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.

  • @devkumarverma7376
    @devkumarverma7376 Рік тому +1

    i am your biggest fan sir if i got any problem i saw your videos for solution thank you for solving all my problems

  • @zainamin8209
    @zainamin8209 Рік тому

    Thank you sir ❤❤❤

  • @giacomogaravaglia6742
    @giacomogaravaglia6742 Рік тому +2

    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!

  • @paschalokafor9043
    @paschalokafor9043 4 місяці тому +1

    How do i prevent an ordinary user from logging into admin dashboard?

  • @development2301
    @development2301 Рік тому

    Thank you

  • @nikolaWd
    @nikolaWd Рік тому

    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?

  • @innocentjosiahpatrick8635
    @innocentjosiahpatrick8635 Рік тому

    Thanks

  • @Mohamadkhalaf
    @Mohamadkhalaf 8 місяців тому

    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 ?

  • @pokemoon4012
    @pokemoon4012 3 місяці тому

    How can i implement canView() function if i am using spatie laravel permission?

  • @fftfaisal
    @fftfaisal Рік тому +1

    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

  • @roberttrivino4484
    @roberttrivino4484 Рік тому

    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

    • @LaravelDaily
      @LaravelDaily  Рік тому +1

      I don't have a repository, it was just an experiment project

  • @darshanbhandary
    @darshanbhandary 11 днів тому

    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.

    • @LaravelDaily
      @LaravelDaily  11 днів тому

      You then have two route pages: regular Laravel routes, and then in Filament you implement User model method canAccessPanel() with return is_admin true

  • @tgames3397
    @tgames3397 Рік тому

    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 🤔

    • @LaravelDaily
      @LaravelDaily  Рік тому +1

      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?

  • @laluheriaguswandi3241
    @laluheriaguswandi3241 11 місяців тому

    How to show or preview pdf file ?

  • @tgames3397
    @tgames3397 Рік тому +2

    Can i use filament for frontend pages outside of the dashboard ? if so how

    • @LaravelDaily
      @LaravelDaily  Рік тому +1

      Filament is for admin area. Not sure WHY you would need to use it for front-end area.

    • @tgames3397
      @tgames3397 Рік тому +1

      @@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

  • @JamesAutoDude
    @JamesAutoDude 11 місяців тому

    I wonder how we can do this in Filament 3 with the new multiple panels setup

    • @LaravelDaily
      @LaravelDaily  11 місяців тому

      I have this video about it: ua-cam.com/video/gJacrxk7v4E/v-deo.html

  • @nilanjanchakraborty2694
    @nilanjanchakraborty2694 Рік тому

    In build packages are really great. But when comes unaccepted requirements then it's so difficult to solve them

  • @asov3x
    @asov3x Рік тому +1

    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

    • @krekas
      @krekas Рік тому

      What's confusing? It's just a livewire component

    • @asov3x
      @asov3x Рік тому

      @@krekas where i should put the livewire code? in app/filament/page ?

    • @krekas
      @krekas Рік тому

      @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.

  • @michaelmagero5386
    @michaelmagero5386 Рік тому

    would going for multi-tenancy to achieve this for say 1000 users be an overkill?

  • @sabinmagar4152
    @sabinmagar4152 9 місяців тому

    I want to disabled the default widget dashboard of filament. I have seen documentation but it's not working. What to do please suggest?

    • @LaravelDaily
      @LaravelDaily  9 місяців тому

      What exactly have you done that is not working? All you need is empty the widgets() array in panel provider.

    • @sabinmagar4152
      @sabinmagar4152 9 місяців тому

      @@LaravelDaily thanks

  • @classicgames2688
    @classicgames2688 Рік тому

    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

    • @LaravelDaily
      @LaravelDaily  Рік тому

      I don't use voyager, sorry

    • @classicgames2688
      @classicgames2688 Рік тому

      ​@@LaravelDailyshould i use filament instead ?

    • @LaravelDaily
      @LaravelDaily  Рік тому +1

      All tools are good if you know how to use them. So it's a personal preference.

    • @classicgames2688
      @classicgames2688 Рік тому

      @@LaravelDaily thank you very much !! Well appreciated

  • @Mr.null7960
    @Mr.null7960 2 місяці тому

    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.

    • @LaravelDaily
      @LaravelDaily  2 місяці тому

      Hard to answer in a UA-cam comment, without specifically trying where ans what you want to present that data.

    • @Mr.null7960
      @Mr.null7960 2 місяці тому

      @@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.

    • @LaravelDaily
      @LaravelDaily  2 місяці тому +1

      You can use Global Scopes for this: filamentphp.com/docs/3.x/panels/tenancy#simple-one-to-many-tenancy

    • @Mr.null7960
      @Mr.null7960 2 місяці тому

      @@LaravelDaily Thank you so much

  • @hindledra2965
    @hindledra2965 11 місяців тому

    Is this doable for resources, or it has to be a widget?
    Thank you

    • @LaravelDaily
      @LaravelDaily  11 місяців тому

      In Filament, it is now done by multiple panels.

    • @hindledra2965
      @hindledra2965 11 місяців тому

      I'm using V2, does that make a difference?@@LaravelDaily

    • @LaravelDaily
      @LaravelDaily  11 місяців тому

      Yes v2 is totally different for that case.

  • @Sunsonar
    @Sunsonar Рік тому +1

    Return null 😂 Robert Martin is 😮😮😮

  • @gdogmalone
    @gdogmalone Рік тому +2

    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! 🫶

    • @LaravelDaily
      @LaravelDaily  Рік тому +1

      With 120k subscribers and daily videos, there's a chance I will hit something like that sometimes :)

    • @fantastique
      @fantastique Рік тому

      @@LaravelDaily You do it all the time for me, thank you!

  • @mosco225
    @mosco225 Рік тому

    Hello mister. How can i upload video with filament ? 😢

    • @LaravelDaily
      @LaravelDaily  Рік тому

      I don't think filament has a specific video field. How is it different from general file upload?

    • @mosco225
      @mosco225 Рік тому

      @@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 😁

    • @mosco225
      @mosco225 Рік тому

      @@LaravelDaily can you Make a tutorial for this part please
      I want to use it on my fitness app

    • @LaravelDaily
      @LaravelDaily  Рік тому +1

      I think I need to create a tutorial about video file uploads in general, yes. But can do it only in a few weeks.

  • @christmex4540
    @christmex4540 11 місяців тому

    in V3 we can have many panels 🤫🤫

    • @LaravelDaily
      @LaravelDaily  11 місяців тому

      Yes, video about exactly that is coming in a few days.

    • @christmex4540
      @christmex4540 11 місяців тому

      @@LaravelDaily Cant wait for that 🔥

  • @FririkurEllefsen
    @FririkurEllefsen 9 місяців тому +1

    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