imanghafoori1 / laravel-password-history

Keep a password history of your users to prevent them from reusing the same password.
MIT License
70 stars 26 forks source link

Not hardcode App\User model #12

Closed muarachmann closed 4 years ago

muarachmann commented 4 years ago

Hi, +1 for this package, I have an issue where I actually create Models directory to be more modular Models/User.php and thus it sees the App\User.php instead of App\Models\User.php however thats not an issue cause we could modify just that line. Could this be made optional as of now it can't publish to vendor


   Error

  Class 'App\User' not found

  at vendor/imanghafoori/laravel-password-history/src/PasswordHistoryServiceProvider.php:31
    27|     {
    28|         $userModels = array_keys(config('password_history.models'));
    29|
    30|         foreach ($userModels as $userModel) {
  > 31|             $userModel::observe(UserObserver::class);
    32|         }
    33|     }
    34|
    35|     private function setMigrationFolder()

      +9 vendor frames
  10  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Imanghafoori\PasswordHistory\PasswordHistoryServiceProvider))

      +5 vendor frames
  16  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
muarachmann commented 4 years ago

PS: This is something to watch out for laravel 8.0 as it is being moved there

imanghafoori1 commented 4 years ago

Will get fixed today.

imanghafoori1 commented 4 years ago

Tryout the v0.1.2, it should be fixed.

muarachmann commented 4 years ago

Hi... I still have the same error