Giter Club home page Giter Club logo

Comments (6)

Kyon147 avatar Kyon147 commented on September 13, 2024 1

Hi @jasontxf

If you are using the blade templates, then yes you need to include the host for every request as you can't store it in the same way that an SPA does. As your page loads multiple times it means you need to always pass it for every page load so you can load in appbridge every time.

from laravel-shopify.

karenirenecano avatar karenirenecano commented on September 13, 2024

Create a query param called host and use base64_encode(Auth::user()->name) append it on the link. I had the same issue and this was my fix.

from laravel-shopify.

jasontxf avatar jasontxf commented on September 13, 2024

@karenirenecano Thanks for replying! Which file do I append the host exactly?

from laravel-shopify.

karenirenecano avatar karenirenecano commented on September 13, 2024

For my case it's on the pricing page. I append it on the url like this billing/1?host=the_base_encoded_shop_name

from laravel-shopify.

jasontxf avatar jasontxf commented on September 13, 2024

ah! I see what you are saying now! I'll give it a try! Thanks alot for the suggestion!

Will update here again after trying.

from laravel-shopify.

jasontxf avatar jasontxf commented on September 13, 2024

Hello,

Here's an updates, your suggestion works very well! Thanks alot!

I created a helper function to include host in every routes to ensure host parameter is included.

function sroute($path, $params) {
    return route($path, [...$params, 'host' => base64_encode(Auth::user()->name)]);
}

That way I dont need to change my current implementation

sroute('billing', ['plan' => 2, 'shop' => Auth::user()->name]) }}"

Though @Kyon147 are we supposed to manually include host in all our links?
Thanks alot for all your time!

from laravel-shopify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.