Why am I having this error? I tried to add use Illuminate\Http\Request;
but same error? Also is $username = $request->input('username');
the same as $username = Input::get('username');
?
The error I get is:
FatalErrorException in LoginController.php line 22: Class 'App\Http\Controllers\Input' not found
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 === '[email protected]') {
return 'Access granted!';
} else {
return 'Access denied! Wrong username or password.';
}
}
}
Add use Input;
after Namespace ...
and then use as Input::get(..)
or don't add use
and call \Input::get(..)
. Find more here: http://php.net/manual/pl/language.namespaces.php