Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

view [auth.login] not found laravel 5

Tags:

laravel

I had made the routes in routes.php file

Route::controller('auth','Auth\AuthController');

Auth/AuthController.php file is

<?php

namespace App\Http\Controllers\Auth;

use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;

use App\Http\Requests\Auth\LoginRequest;
use App\Http\Requests\Auth\RegisterRequest;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

class AuthController extends Controller
{

use AuthenticatesAndRegistersUsers, ThrottlesLogins;

    /**
 * the model instance
 * @var User
 */
protected $user; 
/**
 * The Guard implementation.
 *
 * @var Authenticator
 */
protected $auth;

/**
 * Create a new authentication controller instance.
 *
 * @return void
 */
public function __construct(Guard $auth, User $user)
{

    $this->user = $user; 
    $this->auth = $auth;

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

/**
 * Show the application registration form.
 *
 * @return Response
 */
public function getRegister()
{
    return view('auth.register');
}

/**
 * Handle a registration request for the application.
 *
 * @param  RegisterRequest  $request
 * @return Response
 */
public function postRegister(RegisterRequest $request)
{
    //code for registering a user goes here.
    $this->auth->login($this->user); 
    return redirect('/todo'); 
}

/**
 * Show the application login form.
 *
 * @return Response
 */
public function getLogin()
{
    return view('auth.login');
}

/**
 * Handle a login request to the application.
 *
 * @param  LoginRequest  $request
 * @return Response
 */
public function postLogin(LoginRequest $request)
{
    if ($this->auth->attempt($request->only('email', 'password')))
    {
        return redirect('/todo');
    }

    return redirect('/login')->withErrors([
        'email' => 'The credentials you entered did not match our records. Try again?',
    ]);
}

/**
 * Log the user out of the application.
 *
 * @return Response
 */
public function getLogout()
{
    $this->auth->logout();

    return redirect('/');
}
}

When I hit this auth/login it give me the error -- InvalidArgumentException in FileViewFinder.php line 137: View [auth.login] not found. Can anyone help me out to resolve this issue.?

like image 626
Sakshi Garg Avatar asked Sep 02 '15 13:09

Sakshi Garg


1 Answers

Go to

bootstrap/cache

And rename config.php to config.php_

Im pretty sure you have copied from another site and moved also the cache

like image 196
lucasvm1980 Avatar answered Oct 04 '22 17:10

lucasvm1980