Routing — உங்கள் Laravel Application-ன் GPS
முந்தைய article-ல் Laravel 13-ஐ install செய்து நம்முடைய first route-ஐ create செய்தோம். இப்போது deep-ஆ போகலாம். Routing என்பது Laravel-ல் மிக fundamental concept — உங்கள் application-க்கு வரும் ஒவ்வொரு request-ம் routing system வழியாகத்தான் முதலில் pass ஆகும்.
Routing-ஐ ஒரு restaurant menu போல நினைத்துக்கொள்ளுங்கள். Customer (browser) ஏதாவது order பண்ணும்போது (URL), waiter (router) menu-வை check பண்ணி (routes file), சரியான dish-ஐ (controller action) கண்டுபிடித்து serve பண்ணுகிறார். Menu இல்லாமல் waiter-க்கு என்ன serve பண்ணணும்னு தெரியாது.
இந்த article-ன் முடிவில், Laravel offer செய்யும் ஒவ்வொரு routing concept-ம் உங்களுக்கு புரியும் — basic GET routes-லிருந்து advanced route model binding வரை.
Laravel 13-ல் Routes எங்கே இருக்கு?
Laravel 13-ல் (மற்றும் 11+) routing architecture பழைய versions-லிருந்து significantly மாறியது. Routes bootstrap/app.php-ல் configure செய்யப்படுகின்றன:
// bootstrap/app.php
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->create();
முக்கியமான மாற்றம்: Laravel 10 மற்றும் அதற்கு முந்தைய versions-ல் இருந்த RouteServiceProvider இனி இல்லை. எல்லாமே bootstrap/app.php-ல் withRouting() method-ஐ பயன்படுத்தி configure செய்யப்படுகிறது.
Premium Content
Series-ன் full article-ஐ படிக்க Premium subscribe செய்யுங்கள்.
You've used 3 of 3 free articles today.
Subscribe NowAlready subscribed? Sign in




கருத்துகள் (0)
Be the first to comment!