Courses

Practical Laravel Livewire 2 from Scratch

Second Component: Create Form with Validation

Previous: Deleting Records with Confirmation Prompt
avatar

Is therer any ability to extract that validation and still use FormRequest classes? In FormRequest, you may also restrict some data manipulation in the authorize() method. Is something like this possible using Livewire?

avatar

Livewire doesn't support FormRequest classes, unfortunately.

From the docs: "You might be wondering if you can use Laravel's "FormRequest"s. Due to the nature of Livewire, hooking into the http request wouldn't make sense. For now, this functionality is not possible or recommended."

avatar
You can use Markdown
avatar

i am validating my model Product.name but nothing happens,

avatar

Unfortunately impossible to answer just from this comment, your situation needs debugging on what you validated in the wrong way.

avatar
You can use Markdown
avatar
You can use Markdown