Support the ongoing development of Laravel.io →
posted 10 years ago
Requests
Last updated 2 years ago.
0

They are two completely different subjects.

Routes, take a url and map it to some functionality (a controller).

Requests are the data sent along with a request to a url.

Last updated 2 years ago.
0

So what is the difference here ?

if (Request::is('admin/*'))
{
    //
}
Route::filter('admin', function()
{
    //
});

Route::when('admin/*', 'admin');
Last updated 2 years ago.
0

Think of

if (Request::is('admin/*'))
{
    //
}

as

if ( << Route where the request landed >>  ::is('admin/*'))
{
    //
}

Does it make more sense?? ;)

Last updated 2 years ago.
0

ughhh :)

thx guys, but hahaha, not really.

i can check current route , so i dont really need to check request.

its making the same in 2 different ways ?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

benoone benoone Joined 21 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.