Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

pelican-dev/panel

1722 stars
2 code files
View pelican-dev/panel on GitHub

app/Models/Allocation.php

Open in GitHub
use Illuminate\Database\Eloquent\Casts\Attribute;
 
class Allocation extends Model
{
// ...
 
protected function address(): Attribute
{
return Attribute::make(
get: fn () => (is_ipv6($this->alias) ? "[$this->alias]" : $this->alias) . ":$this->port",
);
}
 
// ...
}

app/Http/Controllers/Api/Client/Servers/NetworkAllocationController.php

Open in GitHub
use App\Models\Server;
use App\Models\Allocation;
use App\Http\Requests\Api\Client\Servers\Network\SetPrimaryAllocationRequest;
use Dedoc\Scramble\Attributes\Group;
 
#[Group('Server - Allocation')]
class NetworkAllocationController extends ClientApiController
{
// ...
 
public function setPrimary(SetPrimaryAllocationRequest $request, Server $server, Allocation $allocation): array
{
// ...
 
Activity::event('server:allocation.primary')
->subject($allocation)
->property('allocation', $allocation->address)
->log();
 
// ...
}
 
// ...
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.