Support the ongoing development of Laravel.io →
Authentication Requests

Hello,

Im pretty new on laravel, and today i'm stuck on simple (it looks like) thing. I have named route. This is a proof:

Named route

When users tries to access admin part, i'm filtering in this way:

Route::filter('admin', function($route) {
  if ($route->getName() != 'admin.login') { return Redirect::route('admin.login'); }
});

Route::when('admin*', 'admin');

I'v tried to debug this by doing die() with some methods, but Route::currentRouteName() or $route->getName() always returns null.

My routes described in this way:

Route::group(array('prefix' => 'admin', 'namespace' => 'admin'), function()
{
  Route::controller('/', 'HomeController');

  Route::controller('users', 'UsersController', ['getLogin' => 'admin.login']);
});

Thank you. Btw, amazing framework. I'v worked on RoR, it was far away from most php frameworks, but laravel is very close :)

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

kticka kticka Joined 7 Aug 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.

© 2025 Laravel.io - All rights reserved.