/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $currentUser = $this->user->find(Auth::id()); $currentRole = current(current($currentUser->roles)); $listIds = explode(",", $id); foreach ($listIds as $item) { if ($currentRole->id != $item) { $this->role->destroy($item); } } return response()->json(['result' => 'Success'], 200); }