You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Basically if we want to implement client-side validation we can do like Aire::open()->rules('key value of rules') or via blade component like <x-aire::form :rules="$rules"/>. Unfortunately, it didn't work as expected when I use blade component. I got an error Cannot unpack array with string keys.
My solutions are:
Use {{Aire::open()->rules($rules)}}
If we wanna use the blade component, make sure that we wrap the $rules with an array bracket ([$rules]). e.g: <x-aire::form :rules="[$rules]" />
My $rules variable:
$rules = [
'full_name' => 'required|string'
];
Have you published the Aire config file?
No
Have you added custom Aire views?
No
What version does this affect?
Laravel Version: 8.77.1
Aire Version: 2.4
To Reproduce
Steps to reproduce the behavior:
Create a blade view. Let's name it as form.blade.php.
Create a new route in web.php. Route::view('/test', 'form');
Visit /test/ and see the error.
Expected behavior
I expect the same result as I use Aire::form()->rules($rules) and <x-aire::form :rules="$rules"/>.
Additional context
OOC. How do I manually trigger the client-side validation? Like Aire.validate(). I tried the client-side validation but it didn't work.
Thank you for this package. I ❤️ it.
The text was updated successfully, but these errors were encountered:
Describe the bug
Basically if we want to implement client-side validation we can do like
Aire::open()->rules('key value of rules')
or via blade component like<x-aire::form :rules="$rules"/>
. Unfortunately, it didn't work as expected when I use blade component. I got an error Cannot unpack array with string keys.My solutions are:
{{Aire::open()->rules($rules)}}
$rules
with an array bracket ([$rules]
). e.g:<x-aire::form :rules="[$rules]" />
My
$rules
variable:Have you published the Aire config file?
No
Have you added custom Aire views?
No
What version does this affect?
To Reproduce
Steps to reproduce the behavior:
form.blade.php
.form.blade.php
with content below:web.php
.Route::view('/test', 'form');
/test/
and see the error.Expected behavior
I expect the same result as I use
Aire::form()->rules($rules)
and<x-aire::form :rules="$rules"/>
.Additional context
OOC. How do I manually trigger the client-side validation? Like
Aire.validate()
. I tried the client-side validation but it didn't work.Thank you for this package. I ❤️ it.
The text was updated successfully, but these errors were encountered: