Black Friday sale is now on! 50% off Laravel: The Modular Way. Learn more

Add items into a request object

David Carr

Laravel Framework PHP & MySQL Tutorials

    To add additional items into the request use ->merge and pass in an array of attributes.

    request()->merge($array);

    The request object will now contain the new array items as part of its body.

    Laravel Modules Book by David Carr

    Help support the blog so that I can continue creating new content!

    Subscribe to my newsletter

    Subscribe and get my books and product announcements.

    © 2009 - 2022 DC Blog. All code MIT license. All rights reserved.