zaster
169
11
Laravel

Assign a 0 to a Null value in a request array

Posted 1 month ago by zaster

I wan to do something like this, before the request goes through a validation

    public function store(Request $request)
    {
        if($request->input('dispatch_item_qty.9') == null)
        {
            $request->input('dispatch_item_qty.9') = 0;
            //dd($request->input('dispatch_item_qty.9'));
        }

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

Reply to

Use Markdown with GitHub-flavored code blocks.