How to use exactly the same rules that I use in Laravel Requests in Livewire Components? I have already build Request in Laravel and I don't want to rebuild it in Livewire. In Livewire i can't use Laravel option (e.g. AppRules). What is the best way to solve this problem because we also have api calls through controllers?
You need to use rules() as a method instead of a property
rules()
use IlluminateValidationRule; public function rules() { return [ 'name' => ['required', new MyRule()], 'content' => 'required|min:10' ]; }
2.1m questions
2.1m answers
60 comments
57.0k users