Laravel Classroom image

Prashant  Nigam / Student / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4|
Lessons:-Routes With Closures

4.4 Route Groups
You may want to apply a number of settings across a range of routes. You can do this easily
using the route grouping option, take a look..
1 <?php
2
3 Route::group(array('before' => 'auth'), function()
4 {
5 Route::get('panel', function()
6 {
7 // do stuff
8 });
9
10 Route::get('dashboard', function()
11 {
12 // do stuff
13 });
14 });
Now both the panel and dashboard routes are protected by the ‘auth’ filter.
Although routing can be very simple, routes can also be as complex as you need them to be. Use
route groups to avoid duplicating common rules across many routes and keep your code DRY.
(Don’t repeat yourself!)
The next chapter will cover the creation of links, so that we can move from one routes page to
the next. Hopefully you will already know how to move from one book page to the next.

 

 
 
 

Prashant  Nigam

Skills    Laravel

Qualifications :-
Location :-,,,
Description:-
Explore
 

  Students (0)