Reputation: 761
I defined a controller LoginController but I am having this error?
ReflectionException in Route.php line 264: Class App\Http\Controllers\LoginController does not exist
class LoginController extends Controller {
// Display the login form
public function showLogin()
{
return View::make('login');
}
// Process submission of the login form by verifying user’s credentials
public function processLogin()
{
$username = Input::get('username');
$password = Input::get('password');
if ($username === 'prince' && $password === 'c@spiAN') {
return 'Access granted!';
} else {
return 'Access denied! Wrong username or password.';
}
}
}
Upvotes: 1
Views: 1691
Reputation: 761
Reinstalling laravel fixed the error without even adding anything.
Upvotes: 0
Reputation: 1234
<?php namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\User;
class LoginController extends Controller {
// Display the login form
public function showLogin()
{
return View::make('login');
}
// Process submission of the login form by verifying user’s credentials
public function processLogin()
{
$username = Input::get('username');
$password = Input::get('password');
if ($username === 'prince' && $password === 'c@spiAN') {
return 'Access granted!';
} else {
return 'Access denied! Wrong username or password.';
}
}
}
Upvotes: 3