Beispiel #1
0
 public function transform($shift)
 {
     $user = $shift->user;
     if ($user) {
         $user = ['id' => $shift->user->id, 'name' => $shift->user->name, 'avatar_url' => $shift->user->avatar_url ? $shift->user->avatar_url : url('img/user.png')];
     }
     return ['id' => $shift->id, "name" => $shift->shift_session->name, 'user' => $user, 'start_time' => format_time_shift(strtotime($shift->shift_session->start_time)), 'end_time' => format_time_shift(strtotime($shift->shift_session->end_time))];
 }
 public function transform($shift_pick)
 {
     $shift = $shift_pick->shift;
     return ["user" => ['name' => $shift_pick->user->name], 'status' => $shift_pick->status, 'shift' => ["name" => $shift->shift_session->name, 'date' => $shift->date, 'start_time' => format_time_shift(strtotime($shift->shift_session->start_time)), 'end_time' => format_time_shift(strtotime($shift->shift_session->end_time))], 'created_at' => format_date_full_option($shift_pick->created_at)];
 }