serenysoft / nova-permissions

Laravel Nova 4 Roles & Permissions
72 stars 25 forks source link

Use Database Seeding #25

Closed KenHuangisGood closed 1 year ago

KenHuangisGood commented 1 year ago

When I use php artisan db:seed to add RolesAndPermissionsSeeder, I got this

 Illuminate\Contracts\Container\BindingResolutionException 

  Target class [Database\Seeders\RolesAndPermissionsSeeder] does not exist.

  at vendor/laravel/framework/src/Illuminate/Container/Container.php:879
    875▕ 
    876▕         try {
    877▕             $reflector = new ReflectionClass($concrete);
    878▕         } catch (ReflectionException $e) {
  ➜ 879▕             throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
    880▕         }
    881▕ 
    882▕         // If the type is not instantiable, the developer is attempting to resolve
    883▕         // an abstract type such as an Interface or Abstract Class and there is

      +8 vendor frames 
  9   database/seeders/DatabaseSeeder.php:17
      Illuminate\Database\Seeder::call("Database\Seeders\RolesAndPermissionsSeeder")

      +22 vendor frames 
  32  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

I'm not sure if I gave the wrong instructions, but in any case, I have managed to solve this problem.