<!-- wp:paragraph -->
<p>When you develop an embedded Shopify App with <a href="https://github.com/Shopify/shopify-app-php">PHP Laravel framework</a>, you can set up your app with <a href="https://shopify.dev/apps/auth/oauth/access-modes">online or offline OAuth mode </a>very easily as below:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>you just need to locate the 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 -->

<!-- wp:paragraph -->
<p>as above snippet codes line 11, it is bool variable:<br>true: means is online mode<br>false: means is offline mode</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you follow the default Shopify guide as your default PHP start project, there is no problem with the default settings (default is online mode).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>if you want to test an offline mode, you will find your product page will show an error message:<br></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"textColor":"vivid-red"} -->
<p class="has-vivid-red-color has-text-color">"There was an issue loading products." </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>that is because, in offline mode, your GraphQL call will fail.</p>
<!-- /wp:paragraph -->