'array', ]; /** * Always record the currently authenticated user * for the audit and the user_id column. */ public static function boot() { parent::boot(); static::saving(function ($model) { $model->user_id = auth()->id(); }); } /** * Relationship to the user who last saved */ public function user() { return $this->belongsTo(User::class); } /** * Relationship to the user who last saved */ public function room() { return $this->belongsTo(StockRoom::class, 'room_id'); } }