Laravel 5.7 ACL in Front-end Using Vue js

  Рет қаралды 20,786

Code Inspire

Code Inspire

Күн бұрын

Пікірлер: 81
@noumanshoaib979
@noumanshoaib979 4 жыл бұрын
This guy is the best.
@samdeacon7910
@samdeacon7910 6 жыл бұрын
you're the greatest. i have lots to do on my app, but how to handle authentication and security was such a worry so glad you are covering this topic 😁
@muslimparvi7981
@muslimparvi7981 4 жыл бұрын
you are just amazing thank you so much for this series
@shabeer2646
@shabeer2646 6 жыл бұрын
ഇത് വളരെ നല്ല ഉപകാരം ആയ വീഡിയോ ആണ് എന്നേലും vue.Js മലയാളികൾ ഉപയോഗിക്കുക ആണേൽ തീർച്ച ആയും കാണുക ഈ വീഡിയോ
@CodeInspire
@CodeInspire 6 жыл бұрын
hmm No idea :D :(
@pathros425
@pathros425 5 жыл бұрын
ഞാനും അതേ.
@pianoboy1018
@pianoboy1018 6 жыл бұрын
What a fabulous series course,thank you!
@CodeInspire
@CodeInspire 6 жыл бұрын
very welcome buddy :)
@qaisnezami1770
@qaisnezami1770 5 жыл бұрын
موفق باشی برادر
@jorembelen7880
@jorembelen7880 4 жыл бұрын
for example i have a Role model. how to implement it in the drop down menu from vuejs?
@amrraouf3525
@amrraouf3525 3 жыл бұрын
amazing
@zayonetcode6421
@zayonetcode6421 4 жыл бұрын
Hi! Thanks so much for your tutorial is really helpful. I do have a question, I put my app in share server but the vueJs does not work as I wanted. Problem with ACL I thing it does not recognize the auth user i do not know why? Do you have any experience on it? Because I did everything here nothing change when us v-if="$gate.IsUser()" but in the localhost works fine
@WeeLiem
@WeeLiem 4 жыл бұрын
when you use window.user = @json(auth()->user()), isn't it users are allowed to change the data via browser's inspect element?
@zeusgolohor8409
@zeusgolohor8409 4 жыл бұрын
Have you found a solution to this yet?
@samanrad
@samanrad 5 жыл бұрын
Hi. Thakns for your tutorials. I use Vuejs2, Vuetify2 and Laravel 6.4 I want to build an E-commerce website (online shopping). I want to make a separeted route addresses for admin and users (with seperated templates). For example domain.com/profile/* is for just users and admins can't login to this witch their credentials. And domain.com/admin/* is for admins and the users can't access and login to that. How can I implement this approach? What is the best, safest and newest way to perform this plan based on most secure and standard logics? What API authentications should I use? Laravel passport or JWT? which one is better? I don't want to modify the blades (just one div with id) and mostly want to work on Vue templates and vue-routers, because of vuetify. Thanks again
@jitendraprajapati417
@jitendraprajapati417 4 жыл бұрын
Hi! Thanks so much for your tutorial is really helpful. can you please share how to manage frontend with this backend. please help with the management structure for the frontend.
@sebastiengarcinibusiness
@sebastiengarcinibusiness 5 жыл бұрын
Why not limit from app.js like : import Gate from "./Gate"; Vue.prototype.$gate = new Gate(window.user); const gate = Vue.prototype.$gate; ----- { path: '/users', component: gate.isSuperAdmin() ? require('./components/Users.vue').default : false },
@jacobtb1
@jacobtb1 5 жыл бұрын
not a bad solution
@nicolasmesa9805
@nicolasmesa9805 4 жыл бұрын
How can i do if a work with a pivot table for managing users: Users | RoleUser | Roles
@michaelikpefua768
@michaelikpefua768 5 жыл бұрын
Please I'm just curious about this two functionality. Vue.protype.$gate = new Gate(window.user) versus window.gate = new Gate(window.user) whats the differences between using vue.prototype vs using window.gate
@mohanc796
@mohanc796 6 жыл бұрын
Thank you so much for your videos ....you are great
@tonyfrenzy
@tonyfrenzy 6 жыл бұрын
You are so amazing, thank you so much for this series.
@CodeInspire
@CodeInspire 6 жыл бұрын
you're very welcome :)
@elinardosilva3812
@elinardosilva3812 5 жыл бұрын
Hello. Very good face tutorial. I'm developing a project with vue following in its footsteps, but only difference is that I'm using API separate from the vue do you understand? So in that case how do I pass the "user" to the gate ()? to break the head in that part because only to give indefinite. THX.
@CodeInspire
@CodeInspire 5 жыл бұрын
Which api your using ? Please explain more
@elinardosilva3812
@elinardosilva3812 5 жыл бұрын
@@CodeInspire hi. I'm use laravel in API but separate from front. In your exemplo vue is inside of laravel. I'm not use blade in my case. Please can help to me user this exemple but in my cenary. Thanks
@elinardosilva3812
@elinardosilva3812 5 жыл бұрын
@@CodeInspire i fix with vuex. in my store i have auth->user() with this comes a user. i import in Gate.js and do window.user = store.auth.me. now is fix my problem, but is good idea this way? thanks
@vitawina158
@vitawina158 5 жыл бұрын
Thanks alot, really help me alot
@fvasquezl
@fvasquezl 5 жыл бұрын
Great
@bikashbhandari5608
@bikashbhandari5608 6 жыл бұрын
u r doing nice job...keep it up
@CodeInspire
@CodeInspire 6 жыл бұрын
thanks buddy :)
@iqrarhussainbuitem12
@iqrarhussainbuitem12 5 жыл бұрын
Perfect tutorials. 1 Question: At the end of master template you put @json(auth()->user()) as we know the auth()->user() is php laravel helper. how does it work in javascript tags means according to my knowledge we can't write Php inside javascript.
@CodeInspire
@CodeInspire 5 жыл бұрын
Yes true. But it’s laravel. We can pass data to JavaScript and read it as JavaScript object.
@iqrarhussainbuitem12
@iqrarhussainbuitem12 5 жыл бұрын
@@CodeInspire thanx
@WebDevMatics
@WebDevMatics 6 жыл бұрын
Good Job ! Nice and easy. Subscribed.
@CodeInspire
@CodeInspire 6 жыл бұрын
Thanks buddy :)
@adam192021
@adam192021 6 жыл бұрын
The BEST as always!
@Raihan004
@Raihan004 4 жыл бұрын
thank you
@heyyy4987
@heyyy4987 5 жыл бұрын
amazing..tanks.
@achowdhury7179
@achowdhury7179 5 жыл бұрын
Hi friend, Thanks for most helpful tutorial. I want to make sure the edit function access who is create the line & also who is admin. How it's possible. Please ...........
@markanthonyarayan9813
@markanthonyarayan9813 5 жыл бұрын
im getting this error Error in created hook: "TypeError: Cannot read property 'position' of undefined" found in ---> at resources/js/components/Doctors.vue
@guren2023
@guren2023 5 жыл бұрын
Does anyone have a solution for this problem? I'm using Laravel 5.8 and it's also showing this error.
@programingrex1129
@programingrex1129 5 жыл бұрын
@@guren2023 @auth window.User = @json(auth()->user()); @endauth
@loremipsum574
@loremipsum574 6 жыл бұрын
Another nice tutorial, Can you show us how to handle 2 types of users. Example SuperAdmin and Admin can use the same link. Another thing is mostly tutorials on the internet shows only one table upon inserting data. I wanted to request, Can you show us how to insert data into 2-3 tables. using only the user's information because in the real world application there about 10 more entities within a user.Thanks for heping .
@CodeInspire
@CodeInspire 6 жыл бұрын
Hi, sure. I can show you. that's supper easy. Just import your modal in store function. then use Model1::create([$data]); Model2::create([$data]);
@loremipsum574
@loremipsum574 6 жыл бұрын
Im trying like this. @if($user->can('isAdmin') || $user->can('isAuthor')) @endif. but in inserting data in 3 tables in database I can't find clearer method.
@justinangeloperez8789
@justinangeloperez8789 6 жыл бұрын
nice one thank you
@pathros425
@pathros425 5 жыл бұрын
My overall question is, right in the Gate.js class, how do you import the currently authenticated user with relational data??? as discussed in this question (stackoverflow.com/q/54764077/1883256) ... for something like: User::with('userProfile')->find(Auth::id()); or return request()->user()->load('userProfile'); or $user->load('relation'); ?
@kevintanudjaja8893
@kevintanudjaja8893 6 жыл бұрын
you're the best!
@CodeInspire
@CodeInspire 6 жыл бұрын
thanks buddy :)
@feranmiafrica9528
@feranmiafrica9528 5 жыл бұрын
In my case the table is still not showing for admin user
@ricardoxavier5440
@ricardoxavier5440 5 жыл бұрын
Hey man! unrelated, but I noticed that on users.vue, the validation for the Type dropdown isn't outputting any messages. I was trying to fix but I can't figure it out. Thanks in advance!
@jendaeliasu
@jendaeliasu 5 жыл бұрын
Hi, I have weird problem: I saved user's data to window.user window.user = @json(auth()->user()); console.log(window.user); // I it working, displays user's data Then in app.js I can NOT access window.user console.log(window) // it is working and I can see user variable with valid data console.log(window.user) // undefined Vue.prototype.$gate = new Gate(window.user) so in Gate.js I have undefined variable Where is the problem?
@CodeInspire
@CodeInspire 5 жыл бұрын
Hi buddy, Did you export it in your gate.js ?
@CodeInspire
@CodeInspire 5 жыл бұрын
Also, please show me any error if you see in console
@jendaeliasu
@jendaeliasu 5 жыл бұрын
I had mistake in line order. I had app.js before that @auth block. And it is working this way: @auth window.User = @json(auth()->user()); @endauth
@fikrimastor
@fikrimastor 6 жыл бұрын
Nice!
@MRFunDuDe100
@MRFunDuDe100 5 жыл бұрын
if a normal user change type from /profile and make him self an admin he will be able to see everything after that how to change it
@pathros425
@pathros425 5 жыл бұрын
Then, the select option should never display the "admin" option. Only a super admin could do that from another ultra secret interface.
@junjun22able
@junjun22able 6 жыл бұрын
Hello, I've been following your tutorial and I like it actually but in this video I want to ask is there a way where I can hide my user data. You see, when you use @json(auth()->user()) and go to "View page source" all user information is showing there and I think it will be so vulnerable.
@CodeInspire
@CodeInspire 6 жыл бұрын
Hi. You have to write it inside @auth block. that way, Only login user can see those information. Also, they see only their own information not others. @auth window.user = @json(auth()->user()) @endauth
@junjun22able
@junjun22able 6 жыл бұрын
@@CodeInspire Hello, thank you so much for your reply sir. ^___^ Well yes, you were right, it's only the authenticated users can see there own data. But I was just thinking maybe there might be another way were we can a bit hide from users eye site all those js code data by just opening "view page source". Actually, In my case I put it in my app.js file by using axios so that it will be included in the webpack as well. And when they open "view page source" users just can see plane HTML. By the way looking forward for another cool tutorials from you co'z I'm also still new with this laravel and vue.js frameworks. Cheers!
@CodeInspire
@CodeInspire 6 жыл бұрын
Hey bro. the user data is not going to be in app.js. I know everyone has access to app.js. Those data will become visible when user login. :) feel free to trust your code :)
@afal
@afal 5 жыл бұрын
How to implement laravel gate and policy in front end
@CodeInspire
@CodeInspire 5 жыл бұрын
Next video we do that. :)
@lifestyletrends5151
@lifestyletrends5151 6 жыл бұрын
Hello sir your method is not working i am using laravel 5.7 and trying to install adminlte but it is not working
@CodeInspire
@CodeInspire 6 жыл бұрын
HI. I am also using Laravel 5.7. Please tell me what's not working ??
@lifestyletrends5151
@lifestyletrends5151 6 жыл бұрын
when i try to install theme in laravel 5.7 css is not working
@CodeInspire
@CodeInspire 6 жыл бұрын
Do you have npm ??
@CodeInspire
@CodeInspire 6 жыл бұрын
I didn't get what do you mean by theme ?
@lifestyletrends5151
@lifestyletrends5151 6 жыл бұрын
yes sir i have
@kenkamonde4581
@kenkamonde4581 6 жыл бұрын
Nice job with the code I downloaded you code from GitHub, I have been struggling to get to the developers view. Please help me out.
@CodeInspire
@CodeInspire 6 жыл бұрын
Please watch the last video in this playlist for that
@jeancastellanosvillalva2300
@jeancastellanosvillalva2300 6 жыл бұрын
Good video, excuse the inconvenience any help to be able to do roles and permissions? inglésespañolfrancésitalianoportugués──────────Ver todos los idiomas TRADUCIR
@CodeInspire
@CodeInspire 6 жыл бұрын
Hi, we are using different approach for roles and permission. We use Laravel ACL :)
@pathros425
@pathros425 5 жыл бұрын
laravel-news.com/two-best-roles-permissions-packages
@amrraouf3525
@amrraouf3525 3 жыл бұрын
The BEST as always!
Design 404 Page for  Front-End If User Doesn't Have Access
12:54
Code Inspire
Рет қаралды 9 М.
How to Upgrade Our Laravel 5.6 to 5.7 (Basic guide)
8:30
Code Inspire
Рет қаралды 11 М.
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 37 МЛН
Who's spending her birthday with Harley Quinn on halloween?#Harley Quinn #joker
01:00
Harley Quinn with the Joker
Рет қаралды 26 МЛН
Easily Add ACL to Laravel Without Extra Tables in Database
7:54
Code Inspire
Рет қаралды 11 М.
Are You Following This Vue Best Practice?
2:43
LearnVue
Рет қаралды 81 М.
Limited Access to Controllers Using ACL in Laravel
7:46
Code Inspire
Рет қаралды 10 М.
How a Nighthawk Was Shot Down
12:06
Yarnhub
Рет қаралды 6 МЛН
Installing AdminLTE 3 on Laravel 5.7 and Bootstrap 4
13:41
Code Inspire
Рет қаралды 197 М.
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 37 МЛН