No video

Laravel Nested Controllers and Scope Bindings For Security

  Рет қаралды 15,682

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер: 36
@hassamulhaq7762
@hassamulhaq7762 2 жыл бұрын
really helpful, I don't know about scope binding. thank you for this video.
@ramina2121
@ramina2121 2 жыл бұрын
Every video I learn new things ! Thank you great work
@tannercampbell
@tannercampbell 2 жыл бұрын
Nice, didn't know about scope bindings! Typically I would create a Policy to check this, and call `$this->authorize(...)`
@DavidSilva-cp8hg
@DavidSilva-cp8hg Жыл бұрын
Amazing!!! I was looking for this group scope bind 🎉 thanks so much
@youssofokiel1269
@youssofokiel1269 2 жыл бұрын
Thanks for your great videos 🔥💯
@HaiNguyen-cf1ji
@HaiNguyen-cf1ji 2 жыл бұрын
Cool, I was looking for some thing like this for a while now
@bulent2435
@bulent2435 2 жыл бұрын
Very good topic. Thanks.
@rahmanjafarinejad6069
@rahmanjafarinejad6069 2 жыл бұрын
Useful tip! Thanks for sharing 👍
@GergelyCsermely
@GergelyCsermely 2 жыл бұрын
Thanks. Excellent idea!!!
@DougLopes
@DougLopes 2 жыл бұрын
amazing as always
@itsaminj9891
@itsaminj9891 2 жыл бұрын
very useful and simple :) thanks a lot!
@pvaitonis
@pvaitonis 2 жыл бұрын
Good tip. Thanks
@prashantpandey7815
@prashantpandey7815 2 жыл бұрын
Very useful.
@taslimsuman
@taslimsuman 2 жыл бұрын
I always do this check but instead id I use slug. Its more readable
@julienSibille
@julienSibille 2 жыл бұрын
Usefull ! Thank you !
@eloquent2200
@eloquent2200 2 жыл бұрын
This is very useful tip, I tried to implement in my project, but it's not working for show method.
@hansherrera5321
@hansherrera5321 2 жыл бұрын
Still not sure why would you want to have project id as an url parameter if you can still get the relationship directly from the task. Didn't know about scopedBindings tho, thanks
@VolkanKAVAS
@VolkanKAVAS 2 жыл бұрын
perfect !
@coipo123
@coipo123 2 жыл бұрын
What's your favorite / ideal way to organize routes ? when projects start to grow, it's a bit weird and it doesn't look good when the routes file starts to grow
@LaravelDaily
@LaravelDaily 2 жыл бұрын
I'm a big fan of route groups and route resources. If it grows too big, then maybe separate routes/xxxxxx.php files but personally not a big fan.
@faalarcon100
@faalarcon100 Жыл бұрын
Please give me the link to the course to learn more about this topic
@andywong2244
@andywong2244 2 жыл бұрын
Povilas, in this example whats the advantage of using nested resource controller compared to just using the single resource controller?
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Just more structured way, totally personal preference
@mahmoud-bakheet
@mahmoud-bakheet 2 жыл бұрын
How cool of that
@lucasj.pereira4912
@lucasj.pereira4912 2 жыл бұрын
Hi Povilas. In this new course, will it also cover roles and permissions for each user in each tenancy?
@LaravelDaily
@LaravelDaily 2 жыл бұрын
For that, I have a separate course: laraveldaily.teachable.com/p/practical-roles-and-permissions-in-laravel - there's a topic about teams at the end
@OnlinePseudonym
@OnlinePseudonym 2 жыл бұрын
Really interesting to see this - did not know it at all. I wonder if there's merit in these nested routes when the task belongs to a single project - if you have the task, then you automatically have easy access to the project. M2m relationships are obviously different. Do you have any thoughts on that?
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Hard to comment, the question feels theoretical "what if", it's better to look at the exact code example and then have thoughts on that.
@OnlinePseudonym
@OnlinePseudonym 2 жыл бұрын
@@LaravelDaily Sure. Since the Task belongs to the object graph of the Project, access to the project is automatically bounded to the project. So I think my point it is (and it's a question I pose to myself as well - not taking anything away from the great video - please keep making your excellent content) - is it simpler / better to (a) use /project/{project}/tasks/{task} and have to add the scope binding declaration, or (b), just have the URL be /tasks/{task}, not have to scope the binding, and if you need to reference the project, simply do it via $task->project.
@soniablanche5672
@soniablanche5672 2 жыл бұрын
is there a way for each project to have their own tasks with autoincrementing id starting from 0? (task primary key would be an a non-unique autoincrementing value and the project id)
@LaravelDaily
@LaravelDaily 2 жыл бұрын
There is a way but it adds huge complexity with custom code, overriding the defaults of the framework, do you REALLY want it?
@soniablanche5672
@soniablanche5672 2 жыл бұрын
@@LaravelDaily No it's for educational purpose. I've always wondered how you could do it.
@dantondelima9934
@dantondelima9934 2 жыл бұрын
Is it possible to use with slugs for the projects and tasks this way?
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Yes, follow the link to the docs and read details there
@bhaviktrambadiya
@bhaviktrambadiya 2 жыл бұрын
Can I use scope binding in api.php?
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Yes
Eloquent Performance: TOP 3 Mistakes Developers Make
7:59
Laravel Daily
Рет қаралды 48 М.
Laravel: 3 Ways to Protect Records from Access By Other Users
7:11
Laravel Daily
Рет қаралды 16 М.
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 161 МЛН
The Joker saves Harley Quinn from drowning!#joker  #shorts
00:34
Untitled Joker
Рет қаралды 65 МЛН
Harley Quinn's revenge plan!!!#Harley Quinn #joker
00:59
Harley Quinn with the Joker
Рет қаралды 22 МЛН
Challenge matching picture with Alfredo Larin family! 😁
00:21
BigSchool
Рет қаралды 41 МЛН
Quick and Easy Nested Categories in Laravel
20:58
Codecourse
Рет қаралды 16 М.
Laravel: Create Public API with Cache and Rate Limits
12:18
Laravel Daily
Рет қаралды 45 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 941 М.
4 Packages You Need in ANY Laravel Project
8:14
Laravel Daily
Рет қаралды 61 М.
The secret behind FrankenPHP: Will it revolutionize PHP?
12:40
Chris Fidao
Рет қаралды 40 М.
Don't Use Polly in .NET Directly. Use this instead!
14:58
Nick Chapsas
Рет қаралды 57 М.
The Tools I Use to Build Products in Laravel
19:00
Josh Cirre
Рет қаралды 23 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 145 М.
4 Tips To Succeed As A Self Taught Developer
11:08
Web Dev Simplified
Рет қаралды 38 М.
Laravel Validation: 12 Less-Known Tips in 13 Minutes
13:11
Laravel Daily
Рет қаралды 38 М.
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 161 МЛН