Roots Discourse

Using Sage 9 with Valet Share - Asset Paths

Does anyone have suggestions on using Sage 9 with Valet Share.

I’ve set my site url dynamically via wp-config, but assets still try to load from the development url.

Much thanks for any help.

Could the Sage 9. update branch fix the issue?

I’m not sure. At the moment I’ve got things working in a rather hacky way by simply doing a string replace before the Blade output.

My rather hacky fix is to update the template function in helpers.php

function template( $file, $data = [] ) {
    return str_replace('example.test', $_SERVER['HTTP_HOST'], sage( 'blade' )->render( $file, $data ));
}

This topic was automatically closed after 42 days. New replies are no longer allowed.