Comments (5)
Hi there !
I am trying to achieve exactly the same thing with Laravel 8: one Instance & Blade layout for the public site, another two for the admin site.Two questions:
When calling the page, the "AppServiceProvider" is not called, so register() is not called either. Did you do something special there ?
How do you scaffold your /resources/ folder to allow 2 Vue instances to live together:
- /resources/js/backend/, /resources/js/frontend/, /resources/views/backend/, /resources/views/frontend/
- Something else ?
Many thanks,
E.
Hey, Inertia has introduced a middleware that handles this. You can run php artisan inertia:middleware
to render it, or go to HandleInertiaRequests.php
and add:
public function rootView(Request $request)
{
if ($request->is(['admin', 'admin/*'])) {
return 'admin.app';
}
return 'frontend.app';
}
from inertia-laravel.
This was totally my error. I forgot to return
the view in my controller return Inertia::render()
.
from inertia-laravel.
@nfunwigabga did you get this working?
from inertia-laravel.
Hi there !
I am trying to achieve exactly the same thing with Laravel 8: one Instance & Blade layout for the public site, another two for the admin site.
Two questions:
- When calling the page, the "AppServiceProvider" is not called, so register() is not called either. Did you do something special there ?
- How do you scaffold your /resources/ folder to allow 2 Vue instances to live together:
- /resources/js/backend/, /resources/js/frontend/, /resources/views/backend/, /resources/views/frontend/
- Something else ?
Many thanks,
E.
from inertia-laravel.
Thanks! Will try that!
from inertia-laravel.
Related Issues (20)
- Laravel/VueJs XSRF/CSRF token rename is not working correctly using the useForm() functionality. HOT 2
- Path to the VUE component outside the module HOT 1
- Connecting to an external host using NodeJS HOT 1
- Add support for bun in `php artisan inertia:start-ssr` HOT 1
- Laravel, Vue 3, SSR and font awesome icons HOT 3
- Laravel redirect response not working HOT 1
- Redirect Back issue HOT 1
- Validate multi step form - with Interia or Axios? HOT 1
- SSR dont work
- inertia laravel opens the page in a new modal HOT 1
- Multiple definitions exist for class 'Route'
- Browser cache controlling
- Data management on the Client Side
- Show toast or message after request complete. HOT 2
- Cant get validation working on laravel-inertia-vue HOT 2
- Login not working with Laravel + Inertia + React HOT 1
- problem in running ssr when using vue vite and ziggy
- Add dinamic parameters to Inertia::lazyLoad props HOT 1
- SSR with Dynamically Shared Props HOT 1
- Providing empty object to the view
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inertia-laravel.