first
This commit is contained in:
27
modules/Task/Http/Resources/TaskBaseResource.php
Normal file
27
modules/Task/Http/Resources/TaskBaseResource.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Task\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Jason\Api\Api;
|
||||
|
||||
class TaskBaseResource extends JsonResource
|
||||
{
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
$user = Api::user();
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'ico' => $this->ico_url,
|
||||
'key' => $this->key,
|
||||
'cover' => $this->cover_url,
|
||||
'title' => $this->title,
|
||||
'tips' => $this->tips,
|
||||
'linker' => $this->linker,
|
||||
'user' => $this->getUserTask($user),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user