本文整理匯總了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'));
}