canBeDeleted() public method

public canBeDeleted ( $type )
Example #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param int    $order_id
  * @param string $type
  *
  * @return void
  */
 public function destroy($order_id, $type)
 {
     if ($this->order->belongToUser(auth()->user(), $order_id, $order) && $this->order->canBeDeleted($type)) {
         $order->details()->delete();
         $order->delete();
         Session::push('message', trans('store.wish_list_view.success_deleting_msg'));
     } else {
         Session::push('message', trans('store.wish_list_view.error_deleting_msg'));
     }
     return redirect()->back();
 }