uuid)) { $institution->uuid = (string) Str::orderedUuid(); } }); } /** * @return array */ protected function casts(): array { return [ 'category_id' => 'integer', 'lat' => 'float', 'lon' => 'float', 'is_storage_place' => 'boolean', 'legacy_id' => 'integer', ]; } /** * La rotta pubblica risolve per uuid, non per id auto-increment. */ public function getRouteKeyName(): string { return 'uuid'; } /** * Categoria dell'istituzione. * * @return BelongsTo */ public function category(): BelongsTo { return $this->belongsTo(InstitutionCategory::class, 'category_id'); } /** * Risorse web collegate (sito ufficiale, ticketing, social, ...). * * @return HasMany */ public function links(): HasMany { return $this->hasMany(InstitutionLink::class); } }