Support the ongoing development of Laravel.io →
Views Forms Validation
Last updated 1 year ago.
0

What do you get if you dd($errors);?

Last updated 1 year ago.
0
object(Illuminate\Support\ViewErrorBag)[127]
  protected 'bags' => 
    array (size=1)
      'default' => 
        object(Illuminate\Support\MessageBag)[129]
          protected 'messages' => 
            array (size=2)
              ...
          protected 'format' => string ':message' (length=8)
Last updated 1 year ago.
0

I've not used ViewErrorBag before, so I'm guessing here, but would you first need to get the default MessageBag using getBag('default') then you'd be able to call get() / first() / has()?

Last updated 1 year ago.
0

Cancel that, looks like the calls are proxied (__call()) to the default bag.

Last updated 1 year ago.
0

It seems that the keys are overwritten to numeric values somewhere.

Last updated 1 year ago.
0

Is this by chance when using the FormRequest class in 4.3? if so see this GitHub issue and related pull request

Hopefully should be merged soon.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Rockroxx rockroxx Joined 13 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.