Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8622469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:03:46+00:00 2026-06-12T07:03:46+00:00

I just started learning Laravel framework today. I would like to check for user’s

  • 0

I just started learning Laravel framework today.

I would like to check for user’s session globally. I put a filter in the constructor of the base class like below.

class Base_Controller extends Controller {

    public function __construct() {

        parent::__construct();

        $this->filter('before', 'auth')->except(array('login@index'));

    }

}

it works fine except that there is one problem. I would like to ignore the auth filter for the login controller. How do I do that?

I tried

except(array(“login”)), except(array(“login.index)), and except(array(“login@index”)). None of them worked

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:03:48+00:00Added an answer on June 12, 2026 at 7:03 am

    Using $this->filter() in a controller has a different approach that doing it in the routes.php file. When you use it inside a controller, except() will just accept methods of that controller.

    You can solve your problem creating a new controller that extends from Base_Controller like Base_Auth_Controller that checks for the auth filter. You could probably use the Route::filter('before', function(){}); and then just return; if you detect that the controller is ‘Auth’ (tip: Request::route()->controller) but you can’t definitely exclude a controller@action.

    Or do something like:

    public function __construct() {
    
        parent::__construct();
    
        // you should check what exactly returns, I don't remember actually
        if(Request::route()->controller != 'Auth_Controller')
        {
             $this->filter('before', 'auth')->except(array('login@index'));
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started learning the Laravel framework and I'm having an issue with routing.
I just started learning ASP.NET MVC4 today. After reading tutorials, downloading VS 2012, and
I just started learning MVC3 today, so please forgive any stupidity (particularly a poorly
I just started learning the zend framework and what im wondering is , is
I just started learning some ruby, and I want to do something like this:
I just started learning Ruby and I ran into a problem today. numResults =
Just started learning c++ today and im pretty boggled. its an amazing language but
Just started learning algorithms. So the exercise is to find if statement is always/sometimes
I just started learning the opencv library for c++. In my previous c++ experience
I just started learning C# and started with Windows Forms project. When I try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.