Exemplo n.º 1
0
 public function update($id, StatusRequest $request)
 {
     // find specific Status
     $status = Status::findOrFail($id);
     $status->update($request->all());
     return redirect('manage/status');
 }
Exemplo n.º 2
0
 public function delete(StatusRequest $requests)
 {
     if (Request::ajax()) {
         $message = Messages::find($requests->input('id'));
         $message->delete();
     }
 }
Exemplo n.º 3
0
 public function status(StatusRequest $requests)
 {
     if (Request::ajax()) {
         $action = $requests->input('action');
         if ($action == 'delete') {
             $user = Users::find($requests->input('id'));
             $user->delete();
         }
         if (!empty($action)) {
             $user = Users::find($requests->input('id'));
             if ($user->is_active == 'blocked') {
                 $user->is_active = 'active';
             } elseif ($user->is_active == 'active') {
                 $user->is_active = 'blocked';
             }
             $user->save();
         }
     }
 }
Exemplo n.º 4
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(StatusRequest $request)
 {
     auth()->user()->statuses()->create($request->all());
     flash()->info('Đăng thành công');
     return redirect('/rimbook');
 }
Exemplo n.º 5
0
 public function delete(StatusRequest $requests)
 {
     $roles = Roles::findOrFail($requests->input('id'));
     $roles->delete();
 }
Exemplo n.º 6
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(StatusRequest $request, $id)
 {
     $status = Status::findOrFail($id);
     $status->update($request->all());
     return redirect('status');
 }