Level 36
you don't get an error with this query, @dawgonking ?
i'd try
$pilot = Pilot::where('emp', request('emp'))
->orderBy('month')
->latest()
->limit(1)
->get();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've added a few additional input fields to the default registration. When a user sends the request I capture their employee number and verify that it exists in the database. I'm trying to return back to the /register page if it does not (null).
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
$pilot = Pilot::where('emp', request('emp'))->get()->sortBy('month')->last();
if($pilot === null)
{
flash('EMPLOYEE VALIDATION FAILED.');
return back();
}
Call to undefined method Illuminate\Http\RedirectResponse::validate()
Also tried:
return redirect('/register');
Only thing that works is return abort(403).
I'd already had issues with this: https://laracasts.com/discuss/channels/requests/auth-register-redirect-upon-fail#reply=489213
Solved using answer. Sorry for duplicate, all.
Please or to participate in this conversation.