I am just picking up using Laravel, but I dont like Vue and have been working with the React ecosystem and would like to use React instead of Vue. Laravel Mix doesnt give me the setup I want and so I figured I could use create-react-app.
Using Laravel Valet, I have started a project in which I have also installed create-react-app in a folder called ui, at the root of the Laravel installation.
My idea is to forego some of Laravel's functionality, namely the whole frontend.
I am attempting to require the react app build html file in resources/views/main.blade.php
like so:
require_once __DIR__.'/ui/build/index.html';
This gives me the error:
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN) Illuminate\View\Engines\PhpEngine::main(): Failed opening required '/Users/Username/Sites/sitename/storage/framework/views/ui/build/index.html' (include_path='.:')
This path is not correct, but I'm not sure why it is inserting /storage/framework/
into that path.
I have also tried the following, each with a similar error of Failed opening resource
:
require_once('../../ui/build/index.html');
require_once($_SERVER['DOCUMENT_ROOT'].'/ui/build/index.html');
require_once(dirname(__FILE__).'/ui/build/index.html');