<!-- wp:paragraph -->
<p>When you develop an embeded Shopify App with PHP Laravel framework, you can set up your app with online or offline OAuth mode very easily as below:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>you just need to locate web.php file at : {php-project-root}/routes/web.php</p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Route::get('/login', function (Request $request) {
    $shop = Utils::sanitizeShopDomain($request->query('shop'));

    if (!$request->hasCookie('shopify_top_level_oauth')) {
        return redirect("/login/toplevel?shop=$shop");
    }

    $installUrl = OAuth::begin(
        $shop,
        '/auth/callback',
        true,
        ['App\Lib\CookieHandler', 'saveShopifyCookie'],
    );

    return redirect($installUrl);
});
</pre>
<!-- /wp:enlighter/codeblock -->