Replies: 1 comment 1 reply
-
public function model(array $row)
{
if (auth()->user()->isSuperAdmin()) {
if (count($row) != 6) {
return null;
}
} In your controller: try {
$import->import("your file");
} catch(\Illuminate\Validation\ValidationException $ex) {
Log::debug("Le nombre de champ n'est pas 6", ["context" => self::class]);
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Depending on the user's role, layout is different, and there should have a different number of fields.
So, I want to be able to throw exception if the number of fields is not 6 for instance when importing users
How should I do that ?
I'm trying to do it like this, but I cannot make it work
Beta Was this translation helpful? Give feedback.
All reactions