import job failing continuously

I am using the database as my queue_driver (connection). as you can see in the screenshot the job is continiously failing, I haven't overriden the code for the Import job and this is all the code that I have written
class UserImporter extends Importer
{
protected static ?string $model = User::class;

public static function getColumns(): array
{
return [
ImportColumn::make('first_name')
->requiredMapping()
->guess(['prenom'])
->rules(['required', 'max:255']),
ImportColumn::make('last_name')
->requiredMapping()
->guess(['nom'])
->rules(['required', 'max:255']),
ImportColumn::make('cin')
->label('CIN')
->requiredMapping()
->rules(['required', 'numeric', 'digits:8']),
ImportColumn::make('email')
->requiredMapping()
->rules(['email_address']),
ImportColumn::make('password')
->requiredMapping()
->guess(['mot de passe', 'pass'])
->rules(['required']),
ImportColumn::make('gsm')
->label('GSM')
->requiredMapping()
->guess(['tel', 'phone', 'gsm'])
->rules(['required', 'numeric', 'digits:8']),
];
}
// the rest is the same as the default importer code...
class UserImporter extends Importer
{
protected static ?string $model = User::class;

public static function getColumns(): array
{
return [
ImportColumn::make('first_name')
->requiredMapping()
->guess(['prenom'])
->rules(['required', 'max:255']),
ImportColumn::make('last_name')
->requiredMapping()
->guess(['nom'])
->rules(['required', 'max:255']),
ImportColumn::make('cin')
->label('CIN')
->requiredMapping()
->rules(['required', 'numeric', 'digits:8']),
ImportColumn::make('email')
->requiredMapping()
->rules(['email_address']),
ImportColumn::make('password')
->requiredMapping()
->guess(['mot de passe', 'pass'])
->rules(['required']),
ImportColumn::make('gsm')
->label('GSM')
->requiredMapping()
->guess(['tel', 'phone', 'gsm'])
->rules(['required', 'numeric', 'digits:8']),
];
}
// the rest is the same as the default importer code...
No description
1 Reply
ronssij
ronssij2w ago
I had the same issue. But what I did was to make sure that the columns are validated properly. for example email should be unique. make sure you have a validation in place that corresponds to your database columns. once it will be validated it will throw an error notification
No description
No description