Laravel auth check for all pages

authentication, laravel, php

Solution

Just check if user is logged in in your views. Or restrict all controller (if you use it) Or check Route Groups, and give a filter to whole group of routes: http://laravel.com/docs/routing#groups

Problem

I have created the Authentication, and its working perfectly. But there is some problem in checking the inner pages. For example, ``` Route::get('/', array('before' => 'auth' , 'do'=> function(){ return View::make('home.index'); })); ``` The index page is only visible for logged in users. But whenever I have go to the inner pages, for example `example.com/products`. The products page can be visible without log in.

Original source