I need to know which button was clicked inside a request form on laravel since i have Save and Update buttons.
public function rules()
$myrule = [ 'name' => 'required', 'age' => 'required' ];
$myrule['application_form'] = 'required';
$myrule['application_form'] = 'required_without:is_application_form';
i need to know if the button that was click is Save or Update because I'm requiring for the application_form file field to be required if the Save button is clicked but I only require the application_form field if the is_application_form hidden field is empty.
the setup above is working for name and age field but ignores the codes inside the IF conditions.
the thing is, this is working when placed inside the controller, just above the MyModel::create() code.