*/ protected $fillable = [ 'description', 'type' ]; /** * Creating new log * @param string $descpr * @return void */ public static function writeLog(string $descpr, string $type = 'access') { self::create(['description' => $descpr, 'type' => $type]); } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'created_at' => 'datetime' ]; } }