*/ protected $dispatchesEvents = [ 'created' => DumpCreated::class, 'deleted' => DumpDeleted::class, 'updated' => DumpUpdated::class, ]; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ Dump::ATTRIBUTE_PATH, ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ Dump::ATTRIBUTE_PATH => 'string', ]; } /** * The link of the dump. */ protected function link(): Attribute { return Attribute::make(function (): ?string { if ($this->getAttribute($this->getRouteKeyName()) !== null && $this->exists) { return route('dump.show', $this); } return null; }); } public function getName(): string { return $this->path; } public function getSubtitle(): string { return $this->getName(); } }