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

Problem installing when User model is not App\User #300

Closed
wagnered opened this issue Jun 16, 2018 · 6 comments · Fixed by #301
Closed

Problem installing when User model is not App\User #300

wagnered opened this issue Jun 16, 2018 · 6 comments · Fixed by #301

Comments

@wagnered
Copy link

Laravel 5.6 is installed.

The user providers array in auth.php is:

 'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\Models\User::class,
        ],`

Looks like 'messenger.user_model' is hard-coded as App\User::class and ignoring 'auth.providers.users.model'.

Regards...

@Gummibeer
Copy link

It's not hardcoded cause it has, like you wrote, a seperated config key:
https://github.com/cmgmyr/laravel-messenger/blob/master/config/config.php
messenger.user_model

@wagnered
Copy link
Author

@Gummibeer

Then please explain why, when I ran composer update the error I got was:

 Illuminate\Foundation\ComposerScripts::postAutoloadDump
 php artisan package:discover

In MessengerServiceProvider.php line 102:
                              
  Class 'App\User' not found  

It should automatically find auth.providers.users.model' and use that, not what was entered in config.php.

I could not run artisan at all until I changed 'user_model' => App\User::class to 'user_model' => App\Models\User::class in your config.php.

This means that the config.php file could not be published.

So, In my mind, it is effectively hard-coded, even though it wasn't intended to be.

I want to incorporate cmgmyr/messenger into the newest version of Ampache, so please explain how I can get the package installed without modifying user_model in the config.php file?

antonkomarev added a commit to cybercog/laravel-messenger that referenced this issue Jun 16, 2018
@antonkomarev
Copy link
Contributor

@wagnered thank you for reporting this issue! I've created PR #301 with fix.

/cc @cmgmyr

@antonkomarev
Copy link
Contributor

antonkomarev commented Jun 16, 2018

@wagnered you can wait for fix to be published, or manually copy config from package to your application and replace user_model value with null.

@antonkomarev
Copy link
Contributor

Its fixed, waiting for 2.16.1 release.

cmgmyr pushed a commit that referenced this issue Jun 16, 2018
@wagnered
Copy link
Author

Thank you, much appreciated...

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

Successfully merging a pull request may close this issue.

3 participants