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)
|
|
|
|
{
|
|
|
|
$obj = [];
|
2018-08-27 00:40:04 +08:00
|
|
|
foreach ($this->collection as $field) {
|
2018-05-10 01:45:24 +08:00
|
|
|
$obj[$field->name] = $field->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $obj;
|
|
|
|
}
|
|
|
|
}
|