Laravel Vue SPA: Roles and Permissions

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 98

  • @ajithlal1688
    @ajithlal1688 4 года назад +6

    When ever I was searching for solution, there is a video from laravel daily.
    Thank you ❤️

  • @alexr3d
    @alexr3d 4 года назад +9

    I don''t know PHP, but your code looks really clean.

  • @nabeelyousafpasha
    @nabeelyousafpasha 4 года назад

    Cloning your repositories on daily basis as soon as new video gets uploaded. Thanks a lot. Enjoying VUE tutorials

  • @salahuddinayubi3906
    @salahuddinayubi3906 3 года назад +3

    for my SPA i used Vuex and mixin file that was imported globaly in app.js file. In mixin file i defined my own function "can(permission_name)" that return true if user has that permission.I fetch all permission from backend in my global component with the name "App.vue" and save all permissions to my Vuex store. Then at the backend simply I used "permission middelware" in "_construct()" of each controller.

    • @ErickJeronimo
      @ErickJeronimo 2 года назад

      Can you share a repo with this ? I`d like to understand better the laravel part

  • @zubayerhossain7074
    @zubayerhossain7074 4 года назад +4

    I get the idea to experiment roles and permission on a vue & laravel spa by this way. But that video is not enough for starter or intermediate programmers. Can you please make a in depth video on that topic?!?
    That would be life saving video, I'm struggling on that roles and permission when it comes to vue and laravel spa, for many days. 😪😪😪
    Thankyou for your informative video ❤️🧡

    • @PovilasKorop
      @PovilasKorop 4 года назад +2

      I think I've explained it in this video as "overview", with links to what packages are used and what is the API return etc. For beginners, it usually depends on what have you tried, what are the errors, and what Auth mechanism you have - Passport/Sanctum etc. So you need debugging help, and not an in-depth video. Maybe at some point, I will add an end-to-end video with all the steps, but it would take many hours, currently not planning, have plans for other topics, sorry.

  • @nestromae
    @nestromae Месяц назад

    Why to make separate route for getting abilities, if one can add roles and permissions in UserResourcee?

  • @amrullahdev8895
    @amrullahdev8895 4 года назад

    Its like another advance level of laravel tutorial . I suscribed . Even if i still dont get the point because my known not into here yet .

  • @engr.anowarulislam5479
    @engr.anowarulislam5479 3 года назад +1

    How to define the services/ability.js file? Help me please!

  • @SanjayaPrasanna03112004
    @SanjayaPrasanna03112004 Год назад +1

    How we can manage user permissions and roles when we have vue app separate from the backend. I use spatie permissions for user roles and permissions from the backend.

    • @naiveneger39
      @naiveneger39 5 месяцев назад

      @SanjajaPrasanna03112004 did you figure it out? Looking for this now

  • @erikjandelange
    @erikjandelange 7 месяцев назад

    How about permissions for a specific Posts?
    I know it can be done with momentum/lock but don’t want to remodel everything to laravel/data.
    Can you point me in a direction or do you know any other package?

  • @rupakgupta9735
    @rupakgupta9735 2 года назад

    Hi,Can you provide full video for this??
    I already customised roles-permission in backend as laravel.

  • @joaovitor8485
    @joaovitor8485 4 года назад

    Finally this video came out!!

  • @lotkutv2392
    @lotkutv2392 4 месяца назад

    Do you have in separated react like this?

  • @AbdullahAlMamun-xu8ls
    @AbdullahAlMamun-xu8ls 3 года назад +1

    Please explain this " " can() accept 2 prams but you use only permission name (1 param). How its work ?
    Thank you.

    • @mreduar
      @mreduar 2 года назад

      I'm wondering the same thing, it doesn't show the ./services/ability code either, and that's where everything is practically done.

    • @mohammadrezaarab7890
      @mohammadrezaarab7890 2 года назад

      @@mreduar Exactly. Looking for a snippet for it.

  • @guillermocava3568
    @guillermocava3568 4 года назад +1

    Man thats awesome, recently had to do an spa with a backend in laravel and the authorization portion of it felt really rigid since I was handling a predefined set of roles and a middlewares to treat authorization, this is completely reusable

  • @davidndanu9655
    @davidndanu9655 3 года назад +1

    Hello, please share your ability.js file.

  • @kevinwakhisi7001
    @kevinwakhisi7001 3 года назад

    I really want to know more about the event hub. Would you point me to a resource to learn more about

  • @taoufiqerroudani4415
    @taoufiqerroudani4415 3 года назад

    Thanks For the tutorial, I have tried to use same concept in my application but in mine every user have only one role inside the AuthGate i used return in_array($user->role->id, $roles); but it keeps giving me 403 error. What Can i Do to fix this ?

  • @DjamalaGomez
    @DjamalaGomez Год назад

    hello sir how to configure with vue3 please

  • @amasuoamasuo2067
    @amasuoamasuo2067 4 года назад +1

    Can i use global mixin $can to replace casl vue, is that make my role and permission dynamic

    • @PovilasKorop
      @PovilasKorop 4 года назад

      Good question, never tried that, so can't answer.

  • @Pavel-c1k
    @Pavel-c1k 3 года назад

    Can I see code your ability file, please? I just can't understand how you did it in that file

  • @kincortezao2024
    @kincortezao2024 4 года назад

    Questions:
    Is possible get free exactly this project?
    If paid, how to do? I can use in my job or necessary pay per year or just pay one time?
    I see your website but i dont found this solution for user access.

  • @waxkubarouun
    @waxkubarouun Год назад

    Although this tutorial is excellent, I would want to see Spatie package roles and permissions with gate similar to this for APIs.

  • @josuebarros-desenvolvedorw2490
    @josuebarros-desenvolvedorw2490 3 года назад

    How I should it do it with NUXT?

  • @ush6939
    @ush6939 2 года назад

    Actual life saver

  • @wahyudi2916
    @wahyudi2916 3 года назад

    awesome as always

  • @GergelyCsermely
    @GergelyCsermely 3 года назад

    Thanks. Interesting. Question: if we the middleware is doing each time SQL query it can not occurse problem with performance if the site has a lot of visitors? Is it possible to cache myabe?

    • @LaravelDaily
      @LaravelDaily  3 года назад +1

      One query per visitor should not be a problem, in 99.99% of cases.

    • @GergelyCsermely
      @GergelyCsermely 3 года назад

      @@LaravelDaily Thx

  • @abdirahmanburyar
    @abdirahmanburyar 4 месяца назад

    and what about the performance

  • @afiqahsaid5763
    @afiqahsaid5763 2 года назад

    hi can you do like this tutorial but for PHP please. appreciate your fast response

  • @hieronabit9077
    @hieronabit9077 Год назад

    hi sir , its great tutorial.
    How to implementation in vue 3 or vuetify

  • @kristofszobacsi5123
    @kristofszobacsi5123 3 года назад

    Sir can i ask you at 1:30 which component are you using that can hold all those chips and show you the existing one or add a new one? i recently started using vue-material and cant seem to find it :/ are you using vue-select the mulstiselect mode or vue-multiselect for this?

  • @surojmaharjan5467
    @surojmaharjan5467 4 года назад

    Sir, did u use vuetify or just css bootstrap in this project? The ui looks so neat and clean.

    • @PovilasKorop
      @PovilasKorop 4 года назад +2

      It's a Material Dashboard from Creative Tim: www.creative-tim.com/product/material-dashboard

  • @jahc007
    @jahc007 4 года назад +1

    Is there any package for angular frontend?

    • @sohailarshed3427
      @sohailarshed3427 3 года назад

      I am also looking same solution for my Angular project.

  • @popelyshyn
    @popelyshyn 4 года назад

    Reload all permission on every change, I think it is not good, maybe when you api return forbidden then you need to refresh vue permissions, what you think?

    • @PovilasKorop
      @PovilasKorop 4 года назад +1

      Good question, it's a personal opinion. Let's put it this way - I don't see anything wrong in additional quick API request every time. If you think that is a problem, then sure, save it locally.

  • @jdttrs808
    @jdttrs808 3 года назад

    Could you pls make full tutorial?, thanks.

  • @mohammadrezaarab7890
    @mohammadrezaarab7890 2 года назад

    Guys PLZ pay attention that this video is bit old and VUE CASL is now at v5 and has different initialization file.

  • @digitaluniverse9826
    @digitaluniverse9826 Год назад

    Hi povilas. Do you have this repo on your github? Would be very helpful

  • @usmanibraheem8377
    @usmanibraheem8377 3 года назад

    Hi thanks for this amazing tutorial. I have a problem. I don't know how to setup the ability plugin and you didn't explain services/ability file. With the package install I didn't get that file. Can you explain why I didn't get that file and how I can create/get that file
    Thanks

    • @tonymyersnz
      @tonymyersnz 3 года назад +1

      github.com/LaravelDaily/QuickAdminPanel-Vue-Example/blob/master/resources/adminapp/js/services/ability.js

    • @sultanL33T
      @sultanL33T 2 года назад

      @@tonymyersnz Thanks mate for the file, Cheers!

  • @amindolati4645
    @amindolati4645 4 года назад

    Hi, when you can Update Vue.js + Laravel: CRUD with SPA Course

    • @PovilasKorop
      @PovilasKorop 4 года назад

      Currently not planning to update that one, planning to create a separate, more advanced, course. But for now, focused on RUclips and QuickAdminPanel, so can't find enough time for courses, unfortunately.

    • @amindolati4645
      @amindolati4645 4 года назад

      @@PovilasKorop So, we must pay again for new course? I thought, you will complete this course and add new lessons to this course. :-(

    • @PovilasKorop
      @PovilasKorop 4 года назад

      @@amindolati4645 as a CRUD course, that course is complete. I never planned to have the same course expanded with more topics. I planned different SPA-related courses, more advanced, with roles/permissions and Vuex.

  • @kirayamato6128
    @kirayamato6128 3 года назад

    Do you have source code sir? Can you share it?

  • @AlfredoElizondoLife
    @AlfredoElizondoLife 4 года назад

    Do you cover this in deep on your laravel vue spa Course?

    • @PovilasKorop
      @PovilasKorop 4 года назад

      No, that Vue SPA is only for simple CRUD, without permissions. I'm planning to shoot a separate more in-depth course about it, but procrastinating on that, while shooting daily videos on youtube :)

  • @ipdev
    @ipdev 4 года назад

    Why are you using abort_if in your controllers when you can just return false?

    • @ipdev
      @ipdev 4 года назад

      I mean the form request, and specifically, the authorize method.

    • @PovilasKorop
      @PovilasKorop 4 года назад

      In Controllers, abort_if is returned with a specific code of 403 forbidden, return false wouldn't return that coe.
      But if you're talking about the Form Requests, then yes, we have plans to change it.

  • @mukangangugi9930
    @mukangangugi9930 6 месяцев назад

    this is abit complicated to understand at first glance. But looks a great soluution

  • @gunarajkhatri5231
    @gunarajkhatri5231 4 года назад

    hello, how can i get its source code of this tutorial ?

    • @PovilasKorop
      @PovilasKorop 4 года назад

      There's no public source code, you need to purchase 2019.quickadminpanel.com

    • @gunarajkhatri5231
      @gunarajkhatri5231 4 года назад

      @@PovilasKorop ok i return array of logged in user permissions when user logged in so how can i use those permissions in vue casl for implementing permissions in vue ? guide me please

  • @jmmacatangay_grizzlybear
    @jmmacatangay_grizzlybear 4 года назад

    Is this with Laravel 7?

  • @DeenrDayiTv
    @DeenrDayiTv 4 года назад

    Can you provide github project link?

    • @PovilasKorop
      @PovilasKorop 4 года назад +1

      There's no github link this time, you can generate it only at our quickadminpanel.com in yearly plan

    • @tonymyersnz
      @tonymyersnz 3 года назад

      github.com/LaravelDaily/QuickAdminPanel-Vue-Example

  • @bebebeb6498
    @bebebeb6498 2 года назад

    Give please source code

  • @user-rn3or6ky1n
    @user-rn3or6ky1n 4 года назад

    Where is the find source code ?

    • @PovilasKorop
      @PovilasKorop 4 года назад +1

      There's no source code this time, it can be generated only with our quickadminpanel.com

  • @kristofszobacsi5123
    @kristofszobacsi5123 3 года назад

    Hello there! is there a course i can buy from you on this subject?

    • @PovilasKorop
      @PovilasKorop 3 года назад +1

      Hi, no, sorry I don't have a course on this

    • @kristofszobacsi5123
      @kristofszobacsi5123 3 года назад

      @@PovilasKorop Im making an admin/users panel for data management and the main page where the clients can see the updated info ,
      im using vue-router, have 3 main routes in my web,
      /dashboard/admin/{any} for admin, /dashboard/{any} for all other users and /{any} where the clients can see the web page...How could i protect the routes in this manner?
      i have spaties roles and permission and laravel passport working, since its a multi tenant app on the admin side i have scopes where each user can see only the data that corresponds to the id of his/her hotel....but in the clients side i dont want that, just by changing the url you can see one hotel or the other...Any ideas? Thanks in advance!

    • @PovilasKorop
      @PovilasKorop 3 года назад +1

      @@kristofszobacsi5123 Well, if you have spatie roles and permission, then clients should not see the hotel just by changing the URL, it should be protected somehow, but not sure in what logic. Do you have clients roles and permissions, too? I'm afraid I can't answer this question properly with some general advice without digging deeper into your code. Generally, the vue-router should load the route anyway, but the data should come from the back-end and should be protected, so without permissions person can type any URL and would see just blank design but without data.

    • @kristofszobacsi5123
      @kristofszobacsi5123 3 года назад

      @@PovilasKorop Hello there! The clients can see the data from the hotels based on the url /tenerife /ibiza etc... because that /{any} is not protected by middleware, just the dashboards are ---> /dashboard/admin/{any} for admin, /dashboard/{any} these...The thing is when i create a user i give him cretain hotel_id, so in the global scope i configured it so that user can see the appropiate data, but ofcourse without passport and spatie if they put something in the url they can still see the data, i fixed that now they see only the sidebar and header menu...but i want to throw them a blank page saying you dont have authorization to watch this hotel or somthing...And i dont know how i can protect the routes on my vue router...since the data is rendering based on the this.$route.params.facility_id for example...And this cant be controlled like this
      ['middleware' => ['auth:api', 'role:Admin', 'permission: hotel_access'] because its already inside a component rendering in /dashboard/{any}....

    • @PovilasKorop
      @PovilasKorop 3 года назад +1

      @@kristofszobacsi5123 No, vue router doesn't know anything about the back-end permissions, it's a front-end code. Sorry it's hard to help in a short youtube comment here, this question is not a 1-minute answer. But generally, you need to call the API for permissions on every route, and then change the page accordingly.

  • @alila3883
    @alila3883 4 года назад

    Thanks

  • @joaovitor8485
    @joaovitor8485 4 года назад +1

    Now just waiting of how to set up correctly Sanctum hehe

  • @yuliarahma1300
    @yuliarahma1300 4 года назад

    plis make the same tutorial but using livewiree, thanks

  • @Talkinglife
    @Talkinglife 4 года назад

    Authorization......