Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThemeServiceProvider not found #98

Open
thewebartisan7 opened this issue Jan 15, 2020 · 3 comments
Open

ThemeServiceProvider not found #98

thewebartisan7 opened this issue Jan 15, 2020 · 3 comments

Comments

@thewebartisan7
Copy link
Contributor

I follow installation guide, which is:

  1. laravel new themes // installed laravel
  2. composer require caffeinated/themes // installed package
  3. php artisan make:theme Bootstrap // created theme

Now works fine if I try to load view, for example bootstrap::welcome

But routes are not loaded, so I added service provider to config/app.php

  1. Themes\Bootstrap\Providers\ThemeServiceProvider::class

And now I get error Class 'Themes\Bootstrap\Providers\ThemeServiceProvider' not found

So I update main composer.json adding PSR-4 for "themes" folder, this:

"autoload": {
        "psr-4": {
            "App\\": "app/",
            "Themes\\": "themes/"
        }
    },

And now works fine...

But there is nothing regarding this step in docs, and I think that command for make theme already update composer...

What am I missing?

Thanks

@kaidesu
Copy link
Contributor

kaidesu commented Feb 6, 2020

shouldn't be needed - refactoring this in a future update

@instudentmedia
Copy link

Hey there, thanks for this package, I've been using caffeinated/modules to great success and am glad to see a themes package as I was previously using a Themes location in caffeinated/modules,

Just getting started with this, it appears step 4 is still required? My routes aren't loaded until that line is added and this line in the document is still present even though there is no longer a ThemeServiceProvider in laravel:

NOTE

Be sure to register your custom service providers within your ThemeServiceProvider. Refer to Laravel's service provider documentation as needed.

@instudentmedia
Copy link

Looks like you do need a call to:

Theme::set(config('themes.active'));

In your AppServiceProvider's boot method as referenced in #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants