2017-12-13 06:58:27 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
2020-03-23 21:31:35 +08:00
|
|
|
use App\Contracts\Resource;
|
2017-12-13 06:58:27 +08:00
|
|
|
|
|
|
|
class Rank extends Resource
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Transform the resource into an array.
|
|
|
|
*
|
2018-08-27 00:40:04 +08:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
*
|
2017-12-13 06:58:27 +08:00
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
|
|
|
return [
|
2018-03-20 09:50:40 +08:00
|
|
|
'name' => $this->name,
|
2018-01-07 05:23:35 +08:00
|
|
|
'subfleets' => Subfleet::collection($this->subfleets),
|
2017-12-13 06:58:27 +08:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|