This commit is contained in:
2022-08-04 08:39:11 +07:00
parent 4fb1723b76
commit ab94607e81
5 changed files with 198 additions and 15 deletions

View File

@@ -12,18 +12,9 @@ class ImportLog extends Model
{
use HasFactory, SoftDeletes, Blameable;
protected static function boot()
{
parent::boot();
// protected $keyType = 'string';
static::creating(function ($model) {
try {
$model->uuid = (string) Str::orderedUuid(); // generate uuid
} catch (\Exception $e) {
abort(500, $e->getMessage());
}
});
}
// public $incrementing = false;
protected $fillable = [
'importable_type',
@@ -34,6 +25,19 @@ class ImportLog extends Model
'progress',
];
// protected static function boot()
// {
// parent::boot();
// static::creating(function ($model) {
// try {
// $model->id = (string) Str::orderedUuid(); // generate uuid
// } catch (\Exception $e) {
// abort(500, $e->getMessage());
// }
// });
// }
public function files()
{
return $this->morphMany(File::class, 'fileable');