*/ use HasFactory; /** * The resource name for this model when it is transformed into an * API representation using fractal. */ public const string RESOURCE_NAME = 'location'; public function getRouteKeyName(): string { return $this->getKeyName(); } /** * Gets the nodes in a specified location. * * @return HasMany */ public function nodes(): HasMany { return $this->hasMany(Node::class); } /** * Gets the servers within a given location. * * @return HasManyThrough */ public function servers(): HasManyThrough { return $this->hasManyThrough(Server::class, Node::class); } }