More work on the API utilizing Laravel 5.5 exception rendering

Also corrects API format to maintain JSONAPI spec
This commit is contained in:
Dane Everitt 2017-12-17 14:57:05 -06:00
parent f30f4b45ba
commit 54b6fb5ebd
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
28 changed files with 464 additions and 391 deletions

View file

@ -0,0 +1,31 @@
<?php
namespace Pterodactyl\Transformers\Api\Admin;
use Pterodactyl\Models\Allocation;
use Pterodactyl\Transformers\Api\ApiTransformer;
class AllocationTransformer extends ApiTransformer
{
/**
* Return a generic transformed allocation array.
*
* @param \Pterodactyl\Models\Allocation $allocation
* @return array
*/
public function transform(Allocation $allocation)
{
return $this->transformWithFilter($allocation);
}
/**
* Determine which transformer filter to apply.
*
* @param \Pterodactyl\Models\Allocation $allocation
* @return array
*/
protected function transformWithFilter(Allocation $allocation)
{
return $allocation->toArray();
}
}