You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

38 lines
883 B

<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class ProjectResource extends JsonResource
{
public function toArray($request)
{
$resource = [
'_service' => 'user',
'_resource' => 'project',
];
foreach ($this->getAttributes() as $attribute => $value) {
switch ($attribute) {
case 'name':
case 'business_id':
case 'slug':
case 'private':
case 'budget':
case 'start':
case 'finish':
case 'created_at':
case 'updated_at':
case 'archived_at':
case 'deleted_at':
$resource[$attribute] = $value;
break;
}
}
return $resource;
}
}