Skip to content

Handling the MissingShopDomainException (Login page)

Luke Walsh edited this page Oct 4, 2023 · 1 revision

If you are using Laravel 8+ and want to handle the exception "MissingShopDomainException" then you can handle this exception using handler.php in Laravel. Go to App > Exceptions > Handler and use this code:

Include this on top

use Osiset\ShopifyApp\Exceptions\MissingShopDomainException; 
use Illuminate\Support\Facades\Redirect;

And inside function register write: 	

public function register(){
        $this->renderable(function(MissingShopDomainException $e){
           return Redirect::to('https://www.shopify.com/login');
        });
}  

This will redirect to the Shopify login page when anyone will try to hit the base url without login.

Welcome to the wiki!

Please see the homepage for a list of relevant pages.

Clone this wiki locally