1
votes

Alright , Everything works well , only when I run the sign in page in the localhost It works well even with the middleware , When I run the project in the host doesnt work (only middleware) which is :

class MemberController extends MasterController {

    function __construct() {

        parent::__construct();

        $this->middleware('member', ['except' => ['getLogout', 'getProfile', 'postProfile']]);
    }

<?php

namespace App\Http\Middleware;

use Closure;
use Session;

class memberStatus {

    public function handle($request, Closure $next) {

        if (!Session::has('member_id')) {

            return $next($request);
        } else {

            return redirect('');
        }
    }

}

I have this file in the middleware folder so everything is ok but It tells me this ReflectionException in Container.php line 737: Class App\Http\Middleware\memberStatus does not exist , by the way the php version of the host is 5.5 is this Relevant ?

I appreciate help !

1
If you solved it, feel free to post an answer on how you did it.Ben Fortune
Sure, it just was the file name not correct .Fadee

1 Answers

0
votes

Don't forget that after making the middleware, if you want it to be accessible in all HTTP requests, you should globally define it in app/Http/Kernel.php.