本文整理汇总了PHP中app\Location::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::destroy方法的具体用法?PHP Location::destroy怎么用?PHP Location::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Location
的用法示例。
在下文中一共展示了Location::destroy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Location::destroy($id);
return Response::json(array('success' => 'Location has been deleted!'));
}
示例2: destroy
public function destroy($encryptedLocationID)
{
if (!Auth::check() || !Auth::user()->is_admin) {
return response(view('errors.403', ['error' => $this->errorMessages['incorrect_permissions']]), 403);
}
$locationID = Crypt::decrypt($encryptedLocationID);
Location::destroy($locationID);
return Redirect::back();
}
示例3: delete
public function delete($city, $id)
{
Location::destroy($id);
return 'Location deleted';
}
示例4: delete
public function delete(Request $request)
{
//locations to be deleted
$data = [];
//check for single delete
if (isset($request->id)) {
$data[] = $request->id;
}
//check for mass delete if no single delete
if (empty($data)) {
$data = $request->input('location_id');
}
//delete
if (!empty($data)) {
Location::destroy($data);
//clear cache, set message, redirect to list
Cache::flush();
session()->flash('message', trans('admin_common.Location deleted'));
return redirect(url('admin/location'));
}
//nothing for deletion set message and redirect
session()->flash('message', trans('admin_common.Nothing for deletion'));
return redirect(url('admin/location'));
}