2020-07-22 22:03:31 +05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources\V4;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
|
|
|
class PersonVoiceResource extends JsonResource
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Transform the resource into an array.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'role' => $this['role'],
|
|
|
|
'anime' => [
|
|
|
|
'mal_id' => $this['anime']['mal_id'],
|
|
|
|
'url' => $this['anime']['url'],
|
2020-07-23 03:00:16 +05:00
|
|
|
'images' => $this['anime']['images'],
|
|
|
|
'title' => $this['anime']['title']
|
2020-07-22 22:03:31 +05:00
|
|
|
],
|
|
|
|
'character' => [
|
|
|
|
'mal_id' => $this['character']['mal_id'],
|
|
|
|
'url' => $this['character']['url'],
|
2020-11-24 18:39:59 +05:00
|
|
|
'images' => $this['character']['images'],
|
2020-07-22 22:03:31 +05:00
|
|
|
'name' => $this['character']['name']
|
|
|
|
]
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|