I have an older Laravel app that I’ve inherited that’s many years old, but it’s currently on Laravel v10. There’s an issue where locally form validation messages and old() input is not populated as expected. Take the below example… if I process validation manually to output the errors I can see them via dd()
. If I let the injected StandaloneSpectatorRegistrationRequest
handle it, the errors/messages won’t be available…
public function postStandaloneRegistration(
StandaloneSpectatorRegistrationRequest $request
) {
// try {
// $validator = Validator::make($request->all(), app(StandaloneSpectatorRegistrationRequest::class)->rules());
// dd($validator->valid(), $validator->messages());
// //dd($request->validate(app(StandaloneSpectatorRegistrationRequest::class)->rules()));
// } catch (ValidationException $e) {
// dd($e->errors());
// }
Here’s how I’m displaying the errors which is consistent with the docs.
@if (isset($errors) && $errors->any())
<div class="alert alert-danger">
@foreach ($errors->all() as $error)
{!! $error !!}<br/>
@endforeach
</div>
@endif
I’m using cookie
as my session driver (I use redis
in prod, but when I use redis locally it won’t login, no errors or anything), and my sessions work fine locally in that I can login, navigate the site, etc without issues. This works fine on production, but not locally.
Locally I’m using a *.local
domain (which is specified via SESSION_DOMAIN
in my .env) What could be interfering with this data being available?