本文整理汇总了PHP中App\Repositories\UserRepository::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRepository::delete方法的具体用法?PHP UserRepository::delete怎么用?PHP UserRepository::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Repositories\UserRepository
的用法示例。
在下文中一共展示了UserRepository::delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
/**
* @param $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
{
$user = $this->user->find($id);
$this->user->delete($id);
Flash::success(trans('admin/users/general.status.deleted'));
return redirect('/admin/users');
}
示例2: destroy
/**
* Remove the specified resource from storage.
*
* @param $id
*
* @return Response
*/
public function destroy($id)
{
$user = $this->userRepository->findById($id);
$eventDescription = trans('back.events.deleted', ['model' => 'Gebruiker', 'name' => $user->email]);
Activity::log($eventDescription);
flash()->success(strip_tags($eventDescription));
$this->userRepository->delete($user);
return redirect(URL::action('Back\\UserController@index', ['role' => $user->role]));
}
示例3: destroy
/**
* Remove the specified User from storage.
*
* @param int $id
*
* @return Response
*/
public function destroy($id)
{
$user = $this->userRepository->findWithoutFail($id);
if (empty($user)) {
Flash::error('User not found');
return redirect(route('users.index'));
}
$this->userRepository->delete($id);
Flash::success('User deleted successfully.');
return redirect(route('users.index'));
}
示例4: destroy
/**
* @param $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
{
$user = $this->user->find($id);
if (!$user->isdeletable()) {
abort(403);
}
Audit::log(Auth::user()->id, trans('admin/users/general.audit-log.category'), trans('admin/users/general.audit-log.msg-destroy', ['username' => $user->username]));
$this->user->delete($id);
Flash::success(trans('admin/users/general.status.deleted'));
return redirect('/admin/users');
}
示例5: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy($id)
{
$this->users->delete($id);
return redirect()->route('admin.users.index');
}
示例6: destroy
/**
* @param $id
*/
public function destroy($id)
{
$this->user->delete($id);
Flash::success('User successfully deleted');
return redirect('/users');
}