Exemple #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  */
 public function destroy($id)
 {
     Wallet::destroy($id);
     Session::flash('flash_message', 'Wallet deleted!');
     return redirect('admin/wallets');
 }
 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('wallet_id');
     }
     //delete
     if (!empty($data)) {
         Wallet::destroy($data);
         //clear cache, set message, redirect to list
         Cache::flush();
         session()->flash('message', trans('admin_common.Wallet Item deleted'));
         return redirect(url('admin/wallet'));
     }
     //nothing for deletion set message and redirect
     session()->flash('message', trans('admin_common.Nothing for deletion'));
     return redirect(url('admin/wallet'));
 }