コード例 #1
0
ファイル: OpsController.php プロジェクト: defenestrator/groid
 /**
  * @param Guard $guard
  * @return \Dingo\Api\Http\Response
  */
 public function index(Guard $guard)
 {
     $user = $guard->user()->id;
     $myOps = Op::whereUserId($user);
     $ops = $myOps->paginate(10);
     return $this->response->paginator($ops, new OpTransformer());
 }
コード例 #2
0
 public function transform(Cycle $cycle)
 {
     $ou = Op::all()->where('id', $cycle->op_id);
     return ['name' => $cycle->name, 'description' => $cycle->description, 'start_date' => $cycle->start_date, 'end_date' => $cycle->end_date, 'medium' => $cycle->medium, 'op' => $ou->pluck('unit_name')];
 }