33 lines
599 B
PHP
33 lines
599 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ImportLog extends Model
|
|
{
|
|
protected $fillable = [
|
|
'type',
|
|
'filename',
|
|
'total_rows',
|
|
'success_count',
|
|
'duplicate_count',
|
|
'failed_count',
|
|
'errors',
|
|
'imported_by',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'errors' => 'array',
|
|
];
|
|
}
|
|
|
|
public function importedBy(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'imported_by');
|
|
}
|
|
}
|