2018-05-10 01:45:24 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class PirepFieldCollection
|
|
|
|
*/
|
|
|
|
class PirepFieldCollection extends ResourceCollection
|
|
|
|
{
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
2019-07-16 03:14:40 +08:00
|
|
|
$res = [];
|
2018-08-27 00:40:04 +08:00
|
|
|
foreach ($this->collection as $field) {
|
2019-07-16 03:14:40 +08:00
|
|
|
$res[$field->name] = $field->value;
|
2018-05-10 01:45:24 +08:00
|
|
|
}
|
|
|
|
|
2019-07-16 03:14:40 +08:00
|
|
|
return $res;
|
2018-05-10 01:45:24 +08:00
|
|
|
}
|
|
|
|
}
|