*/ protected $fillable = [ 'code', 'created_by', 'updated_by', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'id' => 'integer', 'created_by' => 'integer', 'updated_by' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; /** * Get the user who created this record. */ public function creator() { return $this->belongsTo(User::class, 'created_by'); } /** * Get the user who last updated this record. */ public function updater() { return $this->belongsTo(User::class, 'updated_by'); } }