Function returnOrders
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
public function returnOrders()
{
$finorder = collect();
$orders = Order::orderBy('updated_at')->get();
Function register
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
public function register(Request $request)
{
$role = '';
$validator = Validator::make($request->all(), [
'umbrella_id' => 'required',
Avoid too many return
statements within this method.
return response()->json(['error'=>'Invalid Login Details'], 401);
Function refactorCart
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
public function refactorCart($order)
{
$items = $order->items;
$cart = OrderItem::with('extras')->where('order_id', '=', $order->id)->get();