1 year ago

to check if satisfy the condition statement

Posted 1 year ago by EMfinanga

i want to have the condition regarding on my code to check few thing as per below

  1. check if the quantity is less than entered with user, and if is less don't save the data display the list of that product which is less
  • right now my code is working only for one products and save others which is not less than.
  1. Also i i want to check if the product is selected as per query says, if not true then display the error of that products is not satisfy the condition.
    • right now my code is working fine but it checks well but if there is error it save only product which is sastify condition.

below is my code of controller


     for ($a=0; $a < count($ids); $a++)
        //create detail on data faktur


        //update stok
                        ['id', '=', $ido],
                        ['store', '=', $store],
        // apply  conditions
        //check if available

        $check=(int)$data->quantity < (int)$request->qty[$a];
        return redirect()->back()
                    ->with('success','quantity is Less that entered');
            // return view('sales.index')->with('success', 'not register'); 
        // dd($stokl);




i need the help on declare the condition

Please sign in or create an account to participate in this conversation.