I just had to follow this article to the tee: https://www.jobsity.com/blog/how-run-ngrok-test-share-your-local-development
Take note:
instead of just ngrok 8000 type in
ngrok http 8000
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
The website my groupmates and I are working on is only locally available on my laptop. I want them to be able to open the website from their own homes, so that my frontend-focused members may edit and view the changes in the website right there and then. I also want my other group members to be able to test the website.
With all the ways I've tried to make our laravel app temporarily publically available through ngrok, they only show the basic HTML. No CSS and javascript.
First was from: https://vanrossum.dev/5-using-ngrok-with-laravel which involved adding this in the app's AppServiceProvider.php file:
public function boot(\Illuminate\Http\Request $request)
{
if (!empty( env('NGROK_URL') ) && $request->server->has('HTTP_X_ORIGINAL_HOST')) {
$this->app['url']->forceRootUrl(env('NGROK_URL'));
}
// other code
}
, running this on ngrok,
ngrok http -host-header=rewrite laravel-site.test:80
adding the received url to the .env file as NGROK_URL: url and then clearing all app caches after
Result: No CSS or js
Second way involved exposing port 9000 though ngrok, and running php artisan serve --port=9000 on my laravel app. (https://www.youtube.com/watch?v=s8efVe5c1Xg) Same thing, no CSS and js.
Our CSS and js are mixed with CSS and js files linked using asset() and the use of CDNs.
What should I do? Are there better ways to do this?
I just had to follow this article to the tee: https://www.jobsity.com/blog/how-run-ngrok-test-share-your-local-development
Take note:
instead of just ngrok 8000 type in
ngrok http 8000
Please or to participate in this conversation.