Support the ongoing development of →
Forms Laravel
Last updated 3 months ago.

I think just a little bit of flow logic needs to be put in to make this work.

The code below would give the user a form where they put in their reference number, we look up that number and get any additional info from the design and then redirect to the correct url.

// form
<form action="/findMyRef" method="post">
    <input type="text" name="number">

// route
Route::post('/findMyRef', '[email protected]');

// DesignController
public function route(Request $request)
    $design = Design::query()
        ->where('reference_number', $request->number)

    return redirect('/d/' . $design->slug );
Last updated 2 years ago.

Hi Ben, Thank you very much for providing that, totally makes sense and will give that a try. I did post the same question on Reddit and was advised to use Javascript to transfer the ref number directly in to the URL and query it BUT I am liking this idea a whole lot better, also helps as trying to avoid any unnecessary javascript on the project. Thanks again for the insight, hugely appreciated. Chris


Works perfectly and will make sense to do it this way as I can validate the input too. Thanks @Ben


Sign in to participate in this thread!


Your banner here too?

Chris Chris error500 Joined 16 Jan 2020


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 - All rights reserved.