The issue is that the resolve function in createInertiaApp is not set up to handle the Admin directory. To fix this, you need to update the resolve function to check if the component name starts with Admin/ and then import the component from the Admin directory. Here's an updated version of the app.js file:
import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/inertia-vue3'
import './bootstrap';
import '../css/app.css';
createInertiaApp({
resolve: (name) => {
if (name.startsWith('Admin/')) {
return import(`./Pages/Admin/${name}.vue`)
}
return import(`./Pages/${name}.vue`)
},
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(plugin)
.mount(el)
},
})
With this update, the resolve function will check if the component name starts with Admin/ and then import the component from the Admin directory. If the component name does not start with Admin/, it will import the component from the default Pages directory.
Note that you may also need to update the Inertia::render call in your web.php file to use the correct component name:
Route::get('/Admin_Login', function () {
return Inertia::render('Admin/Admin_login');
});