Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Services/Locations/LocationCreationService.php
10279 views
1
<?php
2
3
namespace Pterodactyl\Services\Locations;
4
5
use Pterodactyl\Models\Location;
6
use Pterodactyl\Contracts\Repository\LocationRepositoryInterface;
7
8
class LocationCreationService
9
{
10
/**
11
* LocationCreationService constructor.
12
*/
13
public function __construct(protected LocationRepositoryInterface $repository)
14
{
15
}
16
17
/**
18
* Create a new location.
19
*
20
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
21
*/
22
public function handle(array $data): Location
23
{
24
return $this->repository->create($data);
25
}
26
}
27
28