Files
exchange-2.0/app/Models/TransactionMappingLog.php
T

33 lines
646 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class TransactionMappingLog extends Model
{
protected $fillable = ['imported_by','data','imported_date','type'];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'data' => 'array',
];
}
public static function boot() {
parent::boot();
static::creating(function ($model) {
$model->imported_by = auth()->user()->id;
});
}
}