Single end point REST API
I only have a few quibbling remarks:

Don't Repeat Yourself (D.R.Y.)

Declare $url = $host . $request-&gt;key unconditionally at the start of your method (say, after $host).  Then append text to it if/when needed $url .= '/' . $payload['id'];.
strtoupper($request-&gt;method) is done in each conditional expression.  It is better practice to mutate the string once.  You're also checking the same data for different strings, this is what switch-case blocks are for.
Rather than writing $data (a non-descriptive variable name) over and over, omit the variable declaration entirely and write the data directly into the return.  I regularly advise against single-use variable declarations unless they valuably reduce code width or improve readability.


else if should be elseif in PHP to comply with the PSR-12 coding standard.
All of your thrown exceptions are handled identically, so it seems to be a much cleaner choice to wrap your whole switch block in a single try-catch block.
Maybe you'd like to see the payload when there is a thrown exception; if so, use &quot;data&quot; =&gt; $payload ?? [] in the return.

Your code might be rewrite as:
public function bridge(Request $request)
{
    $host = &quot;http://127.0.0.1:8000/api/&quot;;
    $url = $host . $request-&gt;key;

    if ($request-&gt;has(&quot;payload&quot;)) {
        $payload = json_decode(html_entity_decode($request-&gt;payload), true);
    }

    try {
        switch (strtoupper($request-&gt;method)) {
            case &quot;POST&quot;:
                return Route::dispatch(Request::create($url, 'POST', []));
            case &quot;PUT&quot;:
                $url .= '/' . $payload['id'];
                return Route::dispatch(Request::create($url, 'PUT', []));
            case &quot;DELETE&quot;:
                $url .= '/' . $payload['id'];
                return Route::dispatch(Request::create($url, 'DELETE', []));
            default:
                if ($request-&gt;has(&quot;payload&quot;)) {
                    $url .= &quot;/&quot; . $payload['id'];
                }
                return Route::dispatch(Request::create($url, 'GET'));
         }
     } catch (\Throwable $th) {
         return [
                    &quot;data&quot; =&gt; $payload ?? [],
                    &quot;success&quot; =&gt; false,
                    &quot;code&quot; =&gt; 500,
                    &quot;message&quot; =&gt; $th-&gt;getMessage(),
                ];
     }
}