blank page when logging in

1

I've been with a problem for days, which frankly I do not know why it happens to me.

The issue is that I have a project on localhost, which worked perfectly, and everything worked, until I tried to optimize it (which I'm not sure is that), using the cache (postsController) .... but even using the cache, it still worked perfectly, in fact I spent an afternoon working without any problem, but the next day, after trying to log in (with the correct user) when I gave the login, instead of leaving the administration panel, I was to a blank page.

I tried everything Composer dump-autoload php artisan cache: clear I have even manually deleted all the files in each of the storage folders. Use windows 7 and the storage folder has permissions.

I have also removed the routes in which you have to preload the login middleware, and load it perfectly

routes

Route::group(['prefix' => 'admin','middleware' => 'auth'],
function() {

    Route::get('dashboard', 'admin\adminController@getDashboard');
    Route::resource('posts', 'postController');
    Route::get('notificaciones', 'postController@vistaNotificaciones');
});    

Route::group(['middleware' => 'guest'], function() {
    Route::get('iniciar', 'Auth\AuthController@getLogin');

});


Route::post('iniciar', 'Auth\AuthController@postLogin');
Route::get('registro', 'Auth\AuthController@getRegistro');
Route::post('registro', 'Auth\AuthController@postRegistro');

AuthController

 protected $redirectTo = 'admin/dashboard';

     protected $redirectAfterLogout = '/iniciar';


    public function __construct(Guard $auth)
    {
      $this->auth = $auth;

    }

    protected function validator(array $data)
    {

        $reglas =  [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|min:1|confirmed',
                  ];
        $mensajes =    [
            'required' => 'El campo :attribute es requerido',
            'email' => 'El campo :atribute tiene que tener formato de email',
                    ];

        return  Validator::make($data, $reglas, $mensajes);
    }
     protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
              'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
    }

    public function comprobarValidacion(\Request $request)
    {
         $validador =  $this->validator($request::all());
           $errors = $validador->errors()->all();
           return $validador;
    }

    public function getRegistro()
    {
        return view('auth.register');
    }
   public function postRegistro(\Request $request)
    {
            $validador =  $this->validator($request::all());

           $errors = $validador->errors()->all();

           if(count($errors)>0):

             return Redirect()->back()->withErrors($validador);

            endif;


        $this->create($request::all());

          \Log::useFiles(storage_path().'/logs/sistema.log');
         \Log::info('El usuario '.$request::get('name').' con correo '.$request::get('email').' ha sido creado a las '.date('d-m-Y H:m'));
        \Session::flash('creado','El usuario '.$request::get('name').' ha sido creado exitosamente');
        return Redirect()->back();

    }

     protected function validatorLogin(array $data)
    {

        $reglas =  [
           'email' => 'required|email',
            'password' => 'required',
                  ];
        $mensajes =    [
            'required' => 'El campo :attribute es requerido',
            'email' => 'El campo :atribute tiene que tener formato de email',
                    ];

        return  Validator::make($data, $reglas, $mensajes);
    }

    public function getLogin()
    {

        return view('auth.login');
    }

    public function postLogin(Request $request)

    {
              $validador =  $this->validatorLogin($request::all());
              $errors = $validador->errors()->all();

             if($validador->fails()):
                 return Redirect()->back()->withErrors($validador);
             endif;

            $datos = array('email' => $request::get('email'),

                             'password' => $request::get('password')
                                    );

     if (\Auth::attempt($datos)) :

                 \Log::useFiles(storage_path().'/logs/sistema.log');
                    \Log::info('El usuario '.\Auth::user()->name.' con correo '.\Auth::user()->email.' se ha loqueado a las '.date('d-m-Y H:m'));
                      return Redirect()->to($this->redirectTo); 

            endif;



    }

PostController

public function index(Request $request)
    {


     //  $listapost = \App\modelos//\post::orderBy('updated_at','DESC')->paginate(20);

      $pagina = $request->page;


  //    CACHEANDO LA PAGINACION
         $listapost = \Cache::remember('listapost_'.$pagina,100,function(){
               return \App\modelos\post::orderBy('updated_at','DESC')->paginate(20);
       });
        return View('backend.posts.listaposts',compact('listapost'));

    }

Of the post controller I only put the index method because it is the one that would have to load after the login, but it never loads it, (unless you remove the middleware route and access it directly then if it loads it well).

When I enter the login correctly, I would have to redirect to admin / dashboard, and yet I have to start. I have tried to modify with a dd the post-login method (the post-start route) to see if it loads the method and loads it perfectly.

I have also completely emptied the browser cache (firefox), and I have also tried in another browser (chrome) and same result, after logging blank page staying on the route to start.

Also add that I have rebooted the system several times without any changes. Despite being repetitive I would like to emphasize that all this has been working perfectly for days, only two years ago this happened to me.

Any idea what it can be?

    
asked by KurodoAkabane 15.11.2016 в 11:05
source

0 answers