Laravel Classroom image

Anil  Bist / Professional / 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.

 

 
 
 
image
Anil  Bist

Skills    Laravel

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)