inertia-laravel
inertia-laravel copied to clipboard
Stack Laravel - InertiaJS - React. How to split the frontend into two applications?
Greetings, there is a need to split the frontend application into two parts, one part admin and another part user. Stack Laravel - InertiaJS - React. Assets builder - VITE. What methods can be used to solve this problem? And what should my resources directory look like in the end.
I'd personally recommend creating a base Layout.js
, then creating two layouts that extend this layout:
- Layout.js
- UserLayout.js
- AdminLayout.js
// Layout.js
// Setup your base layout...
return (
<div>{children}</div>
);
// UserLayout.js
return (
<Layout>
<UserNavbar />
{children}
</Layout>
);
// AdminLayout.js
return (
<Layout>
<AdminNavbar />
{children}
</Layout>
);
Then create folders to store unique components/pages:
-
resources/js/Components/Admin/
-
resources/js/Components/User/
-
resources/js/Pages/Admin/
-
resources/js/Pages/User/
Hi there,
Thanks for reporting the problem you are encountering, but it looks like this is a question that may be better suited for a support channel. We only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use the functionality provided by this repository, you can try one of the following channels:
However, this issue will not be locked, and everyone is free to discuss solutions to your problem!