OOOOH ! Finally! I was looking for a simple basic PHP security illustration like this! Please Post more! I am falling in LOVE~!
@MohammedHassarov6 жыл бұрын
Hello, you can use middleware and move all u're routes inside the middleware such as : Route::middleware(['auth:api','can:isAdmin'])->group(function () { Route::apiResource('User', 'API\UserController'); Route::get('profile','API\UserController@profile'); Route::put('profile','API\UserController@updateProfile'); });
@CodeInspire6 жыл бұрын
thanks for your nice suggestion :)
@randyharsh30466 жыл бұрын
good but how I can render "error page" while somebody want to pass to secure page, for example /users ?
@CodeInspire6 жыл бұрын
@@randyharsh3046 do you get any error ?
@randyharsh30466 жыл бұрын
@@CodeInspire no buddy, i just want 404 page and find in your next lessons, thnks
@ricardoxavier54406 жыл бұрын
Awesome tip! Just a heads up, if I'm not mistaken, that is not good for this app. Because then a regular user or author can't update their own profiles. So the profile functions shouldn't be unauthorized.
@thamibn6 жыл бұрын
awesome tutorials, it really helped me understanding laravel and vue....continue doing the good job
@CodeInspire6 жыл бұрын
I'm glad it's helpful buddy :)
@muhamaduzair5375 жыл бұрын
Laravel 5.8 use $this->authorizeResource('isAdmin'); instead of $this->authorize('isAdmin'); if you are using resource Controller
@huysynf5 жыл бұрын
Thank .It solve my problem.
@afganjabrailov24725 жыл бұрын
I did exactly like in your video. It worked with @can but inside the UserController it didn't. What can be the issue?
@dhruvinprajapati43455 жыл бұрын
i have one Query, when i use this.form.post in request it and doing validation in controller it shows error that length less then 10 it good validation perfectly work but when i use axios.post('route',{form:this.form}) then it can not show the validation box error can any one tell me what is different between this.form.post and axios.post
@Catp00p6 жыл бұрын
This series is amazing! Thank you very much. Please keep them coming. I do have one problem, when i move the $this->authorize('isAdmin'); to the constructor, it does not work. It only works when I put it on individual methods. Can you please show us the proper way to put a gate on the entire controller?
@CodeInspire6 жыл бұрын
oh yeah it doesn't work . I will show you how to fix it in future videos. :)
@stack_dev4 жыл бұрын
Why didn't you use Role based ACL? role table and permission tabel
@Mahmudulhasan-ts5hm5 жыл бұрын
thanks. but how a assign to roll for one user
@izclubcom5 жыл бұрын
6:50 "This action is unauthorized" How to hide the same errors and similar in previous videos from Front-end?
@muhamaduzair5375 жыл бұрын
is this issue is solved or not ?
@muhamaduzair5375 жыл бұрын
Laravel 5.8 use $this->authorizeResource('isAdmin'); instead of $this->authorize('isAdmin'); if you are using resource Controller
@adam1920216 жыл бұрын
The BEST as always!
@hichemneggaz68365 жыл бұрын
I tried to use if(Gate::allows('isAdmin')){ //code } But it didn't work Help please
@omarsaulmoralesibarra1176 жыл бұрын
Awesome!
@CodeInspire6 жыл бұрын
thanks :)
@thirishajesudhasan31286 жыл бұрын
hi your tutorial first class. i want use wizard form in vuejs component how can use it?
@CodeInspire6 жыл бұрын
Hi thanks. Well, there are some vuejs package for for wizards. You can use them.
@herdinataputra4136 жыл бұрын
what if two types of users can access same controller?
@CodeInspire6 жыл бұрын
You can use Gate::allows and Gate::denies I will discuss it in future videos, But if you want, you check the laravel documentation :) laravel.com/docs/5.7/authorization#gates
@amrraouf35254 жыл бұрын
awesome
@mohmmedabd-alrazaq39136 жыл бұрын
but why the pages become slow :(
@CodeInspire6 жыл бұрын
hmm, it has nothing to do with the website performance. For development, it might be like this, But for production, you should optimize your files :)
@justinangeloperez87896 жыл бұрын
waiting for your next video when will you upload it?