I am a newbie to Laravel or any php frame work and don't know how or where to make a class. I am following Laracasts Easy Auth tutorial and am stuck.
The following is my AuthController.php, but when I try register I get: ReflectionException in RouteDependencyResolverTrait.php line 53: Class App\Http\Controllers\Auth\Request does not exist.
I would greatly appreciate any help.
Regards Marea (Australia)
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Contracts\Auth\Guard; use Illuminate\Contracts\Auth\Registrar; use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; use App\Http\Controllers\Auth\Request; class AuthController extends Controller { /* |-------------------------------------------------------------------------- | Registration & Login Controller |-------------------------------------------------------------------------- | | This controller handles the registration of new users, as well as the | authentication of existing users. By default, this controller uses | a simple trait to add these behaviors. Why don't you explore it? | */ use AuthenticatesAndRegistersUsers; /** * Create a new authentication controller instance. * * @param \Illuminate\Contracts\Auth\Guard $auth * @param \Illuminate\Contracts\Auth\Registrar $registrar * @return void */ public function getRegister() { return view('auth.register'); } public function postRegister(Request $request) { $validator = $this->registrar->validator($request->all()); if ($validator->fails()) { $this->throwsValidationException( $request, $validator ); } $this->auth->login($this->registrar->create($request->all())); return redirect($this->redirectPath()); } public function getLogin() { return view('auth.login'); } public function postLogin(Request $request) { $this->validate($request, [ 'email' => 'required', 'password' => 'required', ]); $credentials = $request->only('email', 'password'); if ($this->attempt($credentials, $request->has('remember'))) { return redirect()->intended($this->redirectPath()); } return redirect('/auth/login') ->withInput($request->only('email')) ->withErrors([ 'email' => 'These credentials do not match our records.' ]); } public function __construct(Guard $auth, Registrar $registrar) { $this->auth = $auth; $this->registrar = $registrar; $this->middleware('guest', ['except' => 'getLogout']); } }You replace it
use App\Http\Controllers\Auth\Request;
with
use Request;
Hi tuyenlaptrinh
I was a bit nervous about posting because Jimgwhit doesn't seem to like newbies posting (was he never a newbie?), but some times its the only way we can get over a hurdle.
So thank you so much for helping me
Regards Marea xxxxx
Ohhh :)
I think, with a coder, a developer. We will be to a researcher, googler ....:D
I am a user like you. I don't have any permission :)
But i think he's a young man
I'm vietnamese. So sorry for my poor english
@jimgwhit: Sometime we have comfortable with newbies Laravel (I'm a newbie) to make strong communities
May be they don't have any keywords for search.
Like me. Because my english was poor. Sometime, i can't think any keywords for solutions :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community