Laravel Route Grouping: Simple to Very Complex

  Рет қаралды 48,934

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер: 74
@n1vz3r
@n1vz3r 2 жыл бұрын
Thanks to your video, I was able to get some answers while I was shaving )
@DanielJimenez-ig8mv
@DanielJimenez-ig8mv 8 ай бұрын
Hi sr Laravel Daily, I want to tahnks you for videos. I learned too much , greetings from Chile
@AAlani-uz4gm
@AAlani-uz4gm 3 жыл бұрын
Thanks Povilas, this helped me solve a problem i had with namespaces
@leslysuarez9686
@leslysuarez9686 3 жыл бұрын
I just finished the activity you have in your repository about the routes and I realized that I was half lost, but thanks to that now I know a little more. Thank you very much for your time. I saw this video several times that I did not understand well about the route group 🤯
@belce1982
@belce1982 3 жыл бұрын
Thanks as always, learning day by day thanks to you Povilas!
@LeigerGaming
@LeigerGaming 4 жыл бұрын
I did not know about apiResource! Legend.
@Mariia-lr4vx
@Mariia-lr4vx Жыл бұрын
Excellent explanations! Thank you a lot!
@nikkolumahang
@nikkolumahang 4 жыл бұрын
Really nice. I love your practical examples. Keep it up!
@lloydguia3118
@lloydguia3118 3 жыл бұрын
huli ka hahahah
@nikkolumahang
@nikkolumahang 3 жыл бұрын
@@lloydguia3118 follower diay pud ka ani nga channel? hahaha
@lloydguia3118
@lloydguia3118 3 жыл бұрын
@@nikkolumahang Oh hahaha dali ra kaayu ma sabtang iyang tuto
@nikkolumahang
@nikkolumahang 3 жыл бұрын
@@lloydguia3118 ayos kaayo iyang mga tips sa laravel
@amrullahdev8895
@amrullahdev8895 4 жыл бұрын
Such a awesome explanation and tutorial from the simple to advance . Thanks
@judenoel7286
@judenoel7286 Жыл бұрын
This was great very very useful 👌
@HenryDavidLie
@HenryDavidLie 4 жыл бұрын
Your explanation is so on point, i really like that, thankyou!
@Oda3908
@Oda3908 3 жыл бұрын
Great tutorial! Will be even better if mentioned on some option methods such as overwrite the default parameter name.
@AsankaRubasinghe
@AsankaRubasinghe 3 жыл бұрын
Thank you very much for the great explanation sir..
3 жыл бұрын
Awesome, awesome, awesome. Thank you Korop!
@ChangeYourLifeForever
@ChangeYourLifeForever Жыл бұрын
really thank you great explanation
@upliftingspirit6873
@upliftingspirit6873 3 жыл бұрын
I have watched more than 20 videos in just 2 days. This channel is all I was looking for, thank you very much for the effort you put for these videos! I want to ask something. How would you format your resource routes if some actions have different middlewares than the rest? For example, create is allowed for authenticated users, but edit is allowed for authenticated AND the user must own the resource
@LaravelDaily
@LaravelDaily 3 жыл бұрын
I would use Policies for this.
@upliftingspirit6873
@upliftingspirit6873 3 жыл бұрын
@@LaravelDaily Yeah but still the policies have to be assigned (?) (or in the resource controller) Can this be achieved entirely in the routes file ? Namely, assign separate middleware, ie ['middleware' => ['create'=>'create-resource', 'edit' => 'edit-resource']]
@LaravelDaily
@LaravelDaily 3 жыл бұрын
I don't think I've seen that defined in the routes. You activate the middleware for specific controller method directly in that method of that controller. Or, in the constructor: public function __construct() { $this->middleware('auth'); $this->middleware('log')->only('index');
@upliftingspirit6873
@upliftingspirit6873 3 жыл бұрын
@@LaravelDaily Yeah that's the alternative way I saw as well; i guess having them all in the constructor sounds better. Thanks:)
@chlouis-girardot
@chlouis-girardot 4 жыл бұрын
Just awesome ! Thank you so much 👍🏼
@nurudeenqoyyumtimilehin5475
@nurudeenqoyyumtimilehin5475 4 жыл бұрын
If you rewind this video to get one or two concept, thumbs up.
@VijayKumar-rv2mw
@VijayKumar-rv2mw 4 жыл бұрын
So helpful. Thank you.
@azhanhannan1227
@azhanhannan1227 2 жыл бұрын
great sharing, i've learn a l
@issaissifou4959
@issaissifou4959 3 жыл бұрын
Thank you!
@redayoub
@redayoub 4 жыл бұрын
thanks for this informative video
@neelnitin2850
@neelnitin2850 4 жыл бұрын
You are osm man...👍👍
@valcmeza
@valcmeza 4 жыл бұрын
Great video!
@REDIDSoft
@REDIDSoft 4 жыл бұрын
Amazing videos!!!
@R0b3
@R0b3 Жыл бұрын
Hi there. How can I divide my routes that share the same method?I have different roles in my application, admis, doctor, management and so on. I've made a CRUD controller and some methods are allowed and other no by check different roles. How can I reach my scope? I used a Resource controller but I don't know how can I split them. Thanks.
@iHariPatel
@iHariPatel 4 жыл бұрын
Thank you
@RANJEETKUMAR-wz4dg
@RANJEETKUMAR-wz4dg 3 жыл бұрын
thanks
@relliv2019
@relliv2019 4 жыл бұрын
i am using laravel 6, jwt and custom role-permission system, now i am working this method. is it best practise? or any suggestion? /** * Plane */ Route::namespace('Plane')->prefix('plane')->group(function () { /** * Airports */ Route::namespace('Airport')->prefix('airport')->group(function () { $ct = 'AirportController'; Route::get('list', "{$ct}@index")->middleware('role:show_airport'); Route::post('', "{$ct}@store")->middleware('role:add_airport'); Route::get('cities', "{$ct}@cities")->middleware('role:show_airport'); Route::group([ 'prefix' => '{id}', 'where' => [ 'id' => '[0-9]+' ]], function () use ($ct) { Route::get('', "{$ct}@show")->middleware('role:show_airport'); Route::put('', "{$ct}@update")->middleware('role:edit_airport'); Route::delete('', "{$ct}@destroy")->middleware('role:delete_airport'); }); }); });
@waelmoh
@waelmoh 3 жыл бұрын
Big like
@yuliarahma1300
@yuliarahma1300 3 жыл бұрын
if i put controller in sub folder like App\Http\Controllers\Sub1\Sub2\HomeController , how i call it on the route? thanks.
@LaravelDaily
@LaravelDaily 3 жыл бұрын
You call it with full namespace, App\Http...
@yuliarahma1300
@yuliarahma1300 3 жыл бұрын
@@LaravelDaily got it, can it combine with route prefix ?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
Yes. Read the Laravel docs for that.
@samiullah0011
@samiullah0011 3 жыл бұрын
Hey Daily What should syntax be the name of folder in Controller. Mean folder name is singular or plural. Like you created folder called Admin. For example I want to create Category or Categories?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
It's your personal choice
@thesemicolon1971
@thesemicolon1971 4 жыл бұрын
Can you please give some resources related to subdomain routing, generating subdomain for every user like you do in quick admin panel when a bee panel is generated
@PovilasKorop
@PovilasKorop 4 жыл бұрын
This video may help kzbin.info/www/bejne/emOYdKupj7SBrMU But, of course, configuring wildcard subdomain routing requires the web-server and DNS configuration, not only code. So this topic is outside Laravel.
@overLordOrigin
@overLordOrigin 3 жыл бұрын
hi. how can send parameters inside group of middleware?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
You can't send parameters to a group, only to a route
@overLordOrigin
@overLordOrigin 3 жыл бұрын
@@LaravelDaily have not any solutions?i am forcing to use groups
@LaravelDaily
@LaravelDaily 3 жыл бұрын
I don't even imagine how parameters would be used in groups, if each route may have individual parameters. To me, it's not logical.
@ClickShot18mm
@ClickShot18mm 4 жыл бұрын
Which IDE you use?
@PovilasKorop
@PovilasKorop 4 жыл бұрын
Phpstorm
@NebsterSK
@NebsterSK 4 жыл бұрын
It took me a long time to realise that you can have route group WITHOUT prefix & name. I thought it is mandatory.
@SpuxyYEZ
@SpuxyYEZ 4 жыл бұрын
but its actually purpose of group to use name/prefix because middleware and l8 doc advices to use middlewares in controllers + namespacing in laravel8 is not usable anymore because of "Class name resolution"
@ForzaPilot
@ForzaPilot 4 жыл бұрын
Good morning! I'm new to Laravel, and I'm having an issue with eloquent relationships. I have a table for cars and I want to create a relationship with a table for builds. My issue is I haven't been able to figure out how to create the relationship of the build to the car when I enter the build. I have the car_id field working in the build table, but I've only been able to make it work manually. How do I make the relationship of the build to the car work from the build.create.php file?
@ExpDev69
@ExpDev69 4 жыл бұрын
In your Car model, have a relationship build() which "$this->hasOne(Build::class)". In your Build model, have a relationship car() which "$this->belongsTo(Car::class)". You should now be able to use $car->build or $build->car respectively. This assumes that your builds table have a car_id column that points to the car that specific build belongs to.
@ForzaPilot
@ForzaPilot 4 жыл бұрын
Exp Dev The real world examples you’ve done have been very helpful. Could you use my example to show how this is done, or have you already done an example like this? If you’ve already done one please share the link. Thank you for your help!
@ForzaPilot
@ForzaPilot 4 жыл бұрын
Exp Dev It feels like learning how to do this will open up so many possibilities for using Laravel for my projects.
@ExpDev69
@ExpDev69 4 жыл бұрын
@@ForzaPilot You should read the documentation for real world examples and explanations: laravel.com/docs/7.x/eloquent
@ForzaPilot
@ForzaPilot 4 жыл бұрын
Exp Dev Considering how this seems to be one of the core strengths of Laravel I’m surprised I haven’t found a video that shows how to achieve this functionality.
@madaminmj8462
@madaminmj8462 Жыл бұрын
which one is right approach 1. writing auth middleware in route.php 2. writing middleware in controller with construct like this public function __construct() { $this->middleware('auth')->except(['index', 'show']); }
@ifeanyinnaemego
@ifeanyinnaemego 8 ай бұрын
The first option is the preferred option
@UIRETU
@UIRETU 4 жыл бұрын
In laravel 8 this code is completly different
@KoganeNoYubi
@KoganeNoYubi 4 жыл бұрын
in laravel 8 u cant use strings anymore in route definitions , would have to be: Route::resource('/tasks',TaskController::class);
@PovilasKorop
@PovilasKorop 4 жыл бұрын
What? I haven't heard of such a change, can you give any link to the documentation or Github change?
@relliv2019
@relliv2019 4 жыл бұрын
@@PovilasKorop kzbin.info/www/bejne/g5eoYqekgqxpnKc
@JY-xv7ic
@JY-xv7ic 4 жыл бұрын
please enable CC..
@devope
@devope 6 ай бұрын
in dev world it is common to pronounce "roUt"
@soniablanche5672
@soniablanche5672 3 жыл бұрын
and then laravel 8 happened
@aomo5293
@aomo5293 4 жыл бұрын
So Clear, Thank you very much.
@amgadalwattar2863
@amgadalwattar2863 2 жыл бұрын
thanks
Junior Code Review: Better Routes, CRUDs and Validation
17:58
Laravel Daily
Рет қаралды 60 М.
Laravel Roles and Permissions: All CORE Things You Need To Know
16:32
Laravel Daily
Рет қаралды 227 М.
Ful Video ☝🏻☝🏻☝🏻
1:01
Arkeolog
Рет қаралды 14 МЛН
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
From Laravel Blade to Vue.js + API [Live-coding Example]
22:28
Laravel Daily
Рет қаралды 169 М.
Laravel Gems - Pipelines 💎
15:21
Laravel
Рет қаралды 10 М.
Exceptions in Laravel: Why/How to Use and Create Your Own
12:18
Laravel Daily
Рет қаралды 89 М.
[Live-Coding] Refactor Laravel Controller to be Much Shorter
14:55
Laravel Daily
Рет қаралды 77 М.
Jetstream/Fortify Multi-Auth: Roles, Permissions and Guards
19:00
Laravel Daily
Рет қаралды 100 М.
Laravel Language Switcher
27:58
Andre Madarang
Рет қаралды 88 М.
Ep12 - Laravel API Routes Best Practices
12:58
Acadea.io
Рет қаралды 8 М.
Laravel Service Providers: All You Need to Know
13:13
Laravel Daily
Рет қаралды 68 М.
Laravel Routing Basics Tutorial in Hindi / Urdu
31:40
Yahoo Baba
Рет қаралды 103 М.
Ful Video ☝🏻☝🏻☝🏻
1:01
Arkeolog
Рет қаралды 14 МЛН