Change app.blade.php destination (Jetstream)

1.3k views Asked by At

So, I'm exploring the world of Jetstream and Fortify. Problem is that I want to change the default app.blade.php to my folder admin/app.blade.php.

Where is this defines so I can change it? Can't find it anywhere.

Many thanks!

(Ps: Don't know if this is categorised under Laravel of Vue.)

Update: To avoid confusion. I installed a fresh installation of Laravel with Jetstream. I'm using Inertia for developing my CMS. Inertia has a default file in /views. This is called app.blade.php, which calls @inertia. I want to move this file to /views/admin. If I do that, I get this error:

View [app] not found.

Which makes sense, because I moved it. Where do I change the render of app.blade.php to change it to admin/app.blade.php?

UPDATE:

You can register this in your AppServiceProvider.


namespace App\Providers;

use Illuminate\Support\ServiceProvider;

use Inertia\Inertia;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        if (request()->is(['admin', 'admin/*'])) {
            Inertia::setRootView('admin.app');
        }

        Inertia::setRootView('app');
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}```
1

There are 1 answers

1
夜神夜神 On

do like this

YourProjectPath/config/view.php
'paths' => [
        resource_path('views/admin'),
    ],

if in Controller you can do like this

return view('admin.app');