eighty9nine / filament-excel-import

Import data into your resource from excel
MIT License
40 stars 11 forks source link

display validation error #9

Open raonikhil opened 5 months ago

raonikhil commented 5 months ago

This is not an issue, I am asking how do we display the errors? How do I show validations erros by implementing skipping errors/failures during upload and letting the upload continue and finally showing the errors in the end as to which rows failed due to what errors?

I have this validation rules() set, although I am not sure how is this going to be displayed or where should I show this during the upload process:

public function rules(): array
    {
        foreach (Language::cases() as $case) {
            $languages[] = $case->value;
        }

        foreach (Role::cases() as $case) {
            $roles[] = $case->value;
        }

        return [
            'first_name'              => ['required', 'max:255'],
            'last_name'               => ['required', 'max:255'],
            'email'                   => ['required', 'email'],
            'current_language'        => ['required', Rule::in($languages)],
            'role'                    => ['required', Rule::in($roles)],
            'company_name'            => ['required', 'max:255', 'exists:mvl_companies,name'],
            'company_employee_id'     => ['required', 'max:255'],
            'company_employee_budget' => ['required']
        ];
    }
theanadimukt commented 3 months ago

+1

hi-ahmadtabri commented 1 month ago

+1