qirolab / laravel-themer

Multi theme support for Laravel application
https://qirolab.com
MIT License
361 stars 49 forks source link

laravel 11 with fortify login page gives error - Unable to locate a class or view for component [guest-layout]. #51

Open ramonov opened 2 months ago

ramonov commented 2 months ago

Larave 11 with fortify package for auth is showing error- unable to locate a class or view for component [guest-layout] I tried to put the guest-layout page inside resources->views->layouts folder as well but it is not working. What am i doing wrong here? does your package support laravel 11? Do i need to add middleware at bootstrap->app.php?

ramonov commented 2 months ago

tried adding `<?php

use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(DIR)) ->withRouting( web: DIR.'/../routes/web.php', commands: DIR.'/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware) { // $middleware->alias([ 'theme' => \Qirolab\Theme\Middleware\ThemeMiddleware::class, ]); }) ->withExceptions(function (Exceptions $exceptions) { // })->create(); `

still no luck

ramonov commented 2 months ago

I resolved it myself. There is missing folder /app/View/ where component for layouts shall be defined. Missing files are AppLayout.php `<?php

namespace App\View\Components;

use Illuminate\View\Component; use Illuminate\View\View;

class AppLayout extends Component { /**

`<?php

namespace App\View\Components;

use Illuminate\View\Component; use Illuminate\View\View;

class GuestLayout extends Component { /**