This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom Validator to add errors into vuex store and also handle laravel form errors. | |
import { mapGetters } from 'vuex'; | |
import { CLEAR_FORM_ERRORS, ERROR } from '../vuex/types'; | |
import Vue from 'vue'; | |
export default { | |
data() { | |
return { | |
errors: [], | |
keepServerErrors: ['unique', 'boolean', 'exists', 'regular_chars', 'identifier', 'date'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//All your form requests need to extend the coreFormRequest. | |
class CoreFormRequest extends FormRequest { | |
protected $failed = []; | |
/** | |
* Add a field with detailed information about failed fields. | |
* @param \Illuminate\Contracts\Validation\Validator | |
*/ |