spatie/laravel-model-status

InvalidStatusModel on clean install

francoism90 opened this issue · 1 comments

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Symfony\Component\Debug\Exception\FatalThrowableError  : Argument 1 passed to Spatie\ModelStatus\Exceptions\InvalidStatusModel::create() must be of the type string, null given, called in /srv/http/project/vendor/spatie/laravel-model-status/src/ModelStatusServiceProvider.php on line 41

  at /srv/http/project/vendor/spatie/laravel-model-status/src/Exceptions/InvalidStatusModel.php:9
     5| use Exception;
     6| 
     7| class InvalidStatusModel extends Exception
     8| {
  >  9|     public static function create(string $model): self
    10|     {
    11|         return new self("The model `{$model}` is invalid. A valid model must extend the model \Spatie\ModelStatus\Status.");
    12|     }
    13| }

  Exception trace:

  1   Spatie\ModelStatus\Exceptions\InvalidStatusModel::create()
      /srv/http/project/vendor/spatie/laravel-model-status/src/ModelStatusServiceProvider.php:41

  2   Spatie\ModelStatus\ModelStatusServiceProvider::guardAgainstInvalidStatusModel()
      /srv/http/project/vendor/spatie/laravel-model-status/src/ModelStatusServiceProvider.php:28

  Please use the argument -v to see more details.

Fixed: spatie/laravel-medialibrary#1567 (comment)

Seems same issues happen because of caching. Is this a bug or should the user always clear the (config/bootstrap) cache, before running composer install?