Open ReactJsScc opened 2 days ago
Hi, how do you setup this project? I'm curious because the url you open is http://localhost/{project-folder}
. Usually, Laravel project include Laravel + Breeze + Inertia + React can be accessed in http://localhost:8000
. By the way, the Laravel team give a great tutorial for programmer to be more familiar with Laravel framework.
The tutorial called Laravel Bootcamp: https://bootcamp.laravel.com/inertia/installation. Feel free to visit. It covers step by step how to create and run Laravel Project using Inertia + React stack.
I hope it helps.
While php artisan serve runs completely fine, when accessing the project through localhost via the XAMPP file directory, I am getting this issue
If you're accessing your app through http://localhost/{project}/public
, that's an incorrect hosting setup for a Laravel app. You should never access the /public
directory. Instead, you'd use a document_root set to the public folder of your app. Nothing to do with Inertia, just that you wouldn't run a Laravel app that way.
Yes, the behaviour of XAMPP it self is not suitable to run the Laravel project because of the structure the Laravel framework itself. Laravel store the core (index.php
) inside the public
directory. In short, it's tricky to use XAMPP for this case. I would suggest to use Laragon: https://laragon.org to run Laravel project.
Laragon is not maintained and has myriad issues with both PHP extensions and the latest database binaries. Just use Herd and DBngin, non-Laravel projects are trivial to serve via Valet's drivers.
A proper vhost setup will resolve this issue.
Version: @inertiajs/react version: 1.0.0 Describe the problem: After setting up a Laravel + React + Breeze application, I’ve noticed that sometimes the URL in my browser renders incorrectly, showing /public/ twice. For example:
### http://localhost/Ravi/inventory-main/public/Ravi/inventory-main/public/ This happens intermittently and is causing issues with how my application loads.
Steps to reproduce: Set up a Laravel application with React and Breeze. Access the app in the browser using http://localhost/{project-folder}/i Occasionally, the URL will render incorrectly, showing /public/ twice, like in the example above.