Пример #1
0
 /**
  * Remove the team.
  *
  * @param Request $request
  * @param Model   $team
  *
  * @return json
  */
 public function destroy(TeamUserApiRequest $request, Team $team)
 {
     try {
         $t = $team->delete();
         return response()->json(['message' => trans('messages.success.delete', ['Module' => trans('team::team.name')]), 'code' => 2006])->setStatusCode(202, 'DESTROY_SUCCESS');
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 4006])->setStatusCode(400, 'DESTROY_ERROR');
     }
 }
Пример #2
0
 public function transform(\Litecms\Team\Models\Team $team)
 {
     return ['id' => $team->getRouteKey(), 'first_name' => $team->first_name, 'last_name' => $team->last_name, 'designation' => $team->designation, 'photo' => $team->photo, 'description' => $team->description, 'most_valuable_person' => $team->most_valuable_person, 'facebook' => $team->facebook, 'tumblr' => $team->tumblr, 'gmail' => $team->gmail, 'behance' => $team->behance, 'twitter' => $team->twitter, 'status' => $team->status];
 }
Пример #3
0
 /**
  * Remove the specified resource.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy(TeamUserRequest $request, Team $team)
 {
     try {
         $this->repository->delete($team->getRouteKey());
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('team::team.name')]), 'code' => 202, 'redirect' => trans_url('/user/team/team')], 202);
     } catch (Exception $e) {
         redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);
     }
 }
Пример #4
0
 /**
  * Remove the team.
  *
  * @param Model   $team
  *
  * @return Response
  */
 public function destroy(TeamAdminRequest $request, Team $team)
 {
     try {
         $t = $team->delete();
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('team::team.name')]), 'code' => 202, 'redirect' => trans_url('/admin/team/team/0')], 202);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/team/team/' . $team->getRouteKey())], 400);
     }
 }