Advanced Laravel | all about subdomains .

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys in this lesson I will show you how to work with subdomainsail normal first of all I linked my application with DOT test domain using valid link those Command right and now I can access my application delay laravel DOT test as you see here instead of localhost listening on 8000 port and also I changed my app URL here inside those MV file from localhost to below laravel.test so the first step to create subdomain is go to root service provider here under app providers and here our root service provider and you can use root domain method and write the sub domain but it will be full for example blog dot my domain play laravel DOT test right and as you see here like this one I will copy this here and I will use this file for my subdomain roots this file here side Roots I created this file subdomain web here subdomainweb.php so if I go to access to my blog Dot laravel to test order of DOT test here here is my sub domain if I go to my root here is my root returns sub domain another example if I access my subdominal slash test it will return subdomain or test subdomain slash test also it returns test subdomain if I go here to the main domain I have the same root but it will return test main domain without mixing or confusing between each other another important Point here you must Define your sub domains before main domain because if I go here to my a main root web.th root I have the same Roots main domain and The Testament domain but for subdomain I have the same root subdomain test sub domain but when I Define this after main domain the main domain will be written first so back again slash test works and back to blog slash test also main domain will return so it's very important to Define subdomain before main domain like that to make this subdomain Dynamic for example creating subdomain for each user only make it like Dynamic parameter inside URLs and there is to change it for example to sub domain back to our blog for example it returns subdomain or you can change it as you want a lot of will .play laravel within a stop domain and to get this Dynamic subdomain you can get it easily from here as a barometer right sub domain and you can return it as string sub domain for example go to slash test see here returns of the middle level let me add space refresh and any subdominal Ahmad for example anything another point if you want to Define dynamic parameters inside URLs you can Define it for example ID but the first parameter is always subdomain like that and the second will be this Dynamic parameter here ID and we can written both of them here like subdomain and here is ID is ID slash test slash ID3 for example as you see the subdomain is just subdomain here and our URL parameter is 3 as you see here here is how to work with subdomains lrl support me by clicking on like share and subscribe see you in the next video
Info
Channel: Laravel boy
Views: 8,250
Rating: undefined out of 5
Keywords: Laravel, learn laravel, php, laravel boy, advanced laravel, laravel tips and tricks, laravel tips, laravel advanced tips, learn php, laravel, PHP, web, laravel helpers, laravel custom helper methods, master laravel, laravel route, laravel subdomain, laravel subdomain for each user, laravel dynamic subdomain, how to create subdomain in laravel, learn laravel subdomain route
Id: WzVh8vVDWVM
Channel Id: undefined
Length: 4min 36sec (276 seconds)
Published: Sun Nov 20 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.