I have a test controller as below:
namespace App\Http\Controllers\Modules\Test;
use App\Http\Requests;
use Illuminate\Http\Request;
use Auth;
use App\Http\Controllers\Controller;
class TestController extends Controller{
public function __construct(){
$this->middleware('auth');
}
public function index(){
return 'testing from controller';
}
}
When I try to access the index method via router, it bounces back as un-authenticated user! although I am already logged in. But it does not recognise as the user is already logged in. It's behave like user has not been authenticated!
Any suggestions what wrong I am doing?
I have tried with middleware group as below:
Route::group(
['middleware' => 'auth'],
function () {
Route::get('testing', 'App\Http\Controllers\Modules\Test\TestController@index');
}
);
Result is same!!!
Any suggestions what wrong I am doing?
Any help will be much appreciated...