ROUTE, VIEWS, BLADE TEMPLATES
Nguyn Hu Th
PHÁT TRIỂN PHẦN MỀM NGUỒN M
Routing
Basic Routing
Route Parameters
Required Parameters
Optional Parameters
Regular Expression Constraints
Named Routes
Route Groups
Middleware
Namespaces
Sub-Domain Routing
Route Prefixes
Route Model Binding
Implicit Binding
Explicit Binding
Form Method Spoofing
Accessing The Current Route
2
Routing
3
Image from: http://www.savecontactform7.com/everything-you-need-to-know-about-laravel-framework
Basic Routing
Laravel routes: providing a very simple and
expressive method of defining routes:
For most applications, you will begin by defining
routes in your routes/web.php file.
Test: http://localhost/MyProject/public/
4
Route::get ('/', function () {
return view('welcome');
} );
Basic Routing
Test: http://localhost/MyProject/public/foo
5
Route::get ( 'foo', function () {
return 'Hello World';
} );