Ejemplo n.º 1
0
 /**
  * Update the specified resource in storage.
  * PATCH /cityrefs/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $city = CityRef::find($id);
     if (!$city) {
         return $this->respondNotFound('City not found');
     }
     if ($city->fill(Input::all())) {
         return $city;
     }
     return $this->respondServerError('Error updating city');
 }
Ejemplo n.º 2
0
 /**
  * Display the specified resource.
  * GET /admin/users/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $user = User::withTrashed()->find($id);
     return View::make('admin.users.show', ['title' => $user->name, 'img' => $user->img_middle, 'id' => $user->id, 'user' => [['Имя', $user->name], ['Пол', $user->sex], ['День рождения', $user->birthday], ['Город', $this->returnIfPresent(CityRef::find($user->city), 'ru')], ['Телефон', $this->returnIfPresent($user->phone, 'number')], ['Почта', $user->email], ['О себе', $user->about]], 'actions' => $this->makeLinks($this->expandList([['show', 'Профиль'], ['cars', 'Список машин'], ['chats', 'Чаты'], ['blackList', 'Блокированные пользователи'], ['posts', 'Посты'], ['comments', 'Комментарии'], ['devices', 'Устройства'], ['images', 'Изображения']]), ['controller' => 'AdminUsersController', 'params' => [$user->id]]), 'statistics' => [['string' => 'отправленных сообщений', 'value' => $user->messages()->count()], ['string' => 'отправленных срочных вызовов', 'value' => $user->emergencies()->count()], ['string' => 'сделанных пользователем первых контактов', 'value' => 12], ['string' => 'постов', 'value' => $user->posts->count()], ['string' => 'полученныз пользователем комментариев', 'value' => $user->comments->count()], ['string' => 'полученных пользователем лайков', 'value' => $user->likes->count()], ['string' => 'отправленных жалоб', 'value' => $user->complaints()->count()], ['string' => 'жалоб на пользователя', 'value' => $user->complaintsToMe()->count()], ['string' => 'блокированных пользователем', 'value' => $user->blockedUsers()->count()], ['string' => 'пользователей заблокировавших данного пользователя', 'value' => $user->blockedMeUsers()->count()]]]);
 }