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))
When I use
php artisan db:seed
to add RolesAndPermissionsSeeder, I got thisphp artisan vendor:publish --provider="Sereny\NovaPermissions\ToolServiceProvider" --tag="seeds"
$this->call(RolesAndPermissionsSeeder::class)
toDatabaseSeeder.php
php artisan db:seed
I'm not sure if I gave the wrong instructions, but in any case, I have managed to solve this problem.
RolesAndPermissionsSeeder.php
fromdatabase/seeds
todatabase/seeders
namespace Database\Seeders;
inRolesAndPermissionsSeeder.php
php artisan db:seed