Это видео недоступно.
Сожалеем об этом.

Laravel Vue SPA: Roles and Permissions

Поделиться
HTML-код
  • Опубликовано: 7 сен 2020
  • How to protect your SPA routes, both from the front-end and the back-end? So you need to show/hide menu items and buttons, but also secure API endpoints with Gates.
    Download our solution in our QuickAdminPanel's Yearly Plan: quickadminpanel.com
    The package used: www.npmjs.com/package/@casl/vue

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

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

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

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

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

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

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

  • @salahuddinayubi3906
    @salahuddinayubi3906 2 года назад +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

  • @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 2 месяца назад

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

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

    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?

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

    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 .

  • @zubayerhossain7074
    @zubayerhossain7074 3 года назад +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 3 года назад +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.

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

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

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

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

    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.

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

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

    Finally this video came out!!

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

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

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

    Do you have in separated react like this?

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

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

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

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

  • @guillermocava3568
    @guillermocava3568 3 года назад +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

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

  • @user-kf9ih4nz4z
    @user-kf9ih4nz4z Год назад

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

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

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

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

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

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

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

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

    Hello, please share your ability.js file.

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

    awesome as always

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

    and what about the performance

  • @user-pf2ge9hu3w
    @user-pf2ge9hu3w 3 года назад

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

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

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

    Actual life saver

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

  • @DjamalaGomez
    @DjamalaGomez 8 месяцев назад

    hello sir how to configure with vue3 please

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

    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 3 года назад +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.

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

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

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

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

    Is there any package for angular frontend?

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

      I am also looking same solution for my Angular project.

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

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

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

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

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

    Could you pls make full tutorial?, thanks.

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

    How I should it do it with NUXT?

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

    Thanks

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

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

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

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

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

      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.

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

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

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

      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 :)

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

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

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

      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 3 года назад

      @@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 3 года назад

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

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

    Is this with Laravel 7?

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

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

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

    Now just waiting of how to set up correctly Sanctum hehe

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

    plis make the same tutorial but using livewiree, thanks

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

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

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

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

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

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

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

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

    Where is the find source code ?

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

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

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

    Give please source code

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

    Can you provide github project link?

    • @PovilasKorop
      @PovilasKorop 3 года назад +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

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

    Authorization......