As of August 2024, Splade is no longer actively maintained. Though we will try to keep up with future Laravel and PHP versions, we discourage using Splade in new projects.

After a period of reflection, we've come full circle and decided to bring the magic of Splade back to Inertia, where it all started. Please check out this new chapter in our journey: Inertia UI.

X-Splade-Errors Component

You may use the Errors Component to show validation errors. For each key, Laravel returns an array of errors, so there's a helper method to retrieve the first error of the key:

<x-splade-errors>
<p v-if="errors.has('name')" v-text="errors.first('name')" />
</x-splade-errors>

You may also access the array by using the key directly on the errors prop:

<x-splade-errors>
<p>Name errors: <span v-text="errors.name.length" /></p>
</x-splade-errors>

Alternatively, you can loop through all errors:

<x-splade-errors>
<div v-for="(errors, key) in errors.all">
...
</div>
</x-splade-errors>