creativetimofficial/ct-argon-dashboard-pro-laravel

Seeder Problems

Closed this issue · 4 comments

Lateste Version of Argon for Laravel

The problem:

php artisan make: model Necessidade -a -c -m

Add NecessidadeSeeder on DatabaseSeeder

Illuminate\Contracts\Container\BindingResolutionException

Target class [NecesssidadeSeeder] does not exist.

at C:\xampp\htdocs\adm\vendor\laravel\framework\src\Illuminate\Container\Container.php:811
807▕
808▕ try {
809▕ $reflector = new ReflectionClass($concrete);
810▕ } catch (ReflectionException $e) {
➜ 811▕ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
812▕ }
813▕
814▕ // If the type is not instantiable, the developer is attempting to resolve
815▕ // an abstract type such as an Interface or Abstract Class and there is

1 C:\xampp\htdocs\adm\vendor\laravel\framework\src\Illuminate\Container\Container.php:809
ReflectionException::("Class NecesssidadeSeeder does not exist")

2 C:\xampp\htdocs\adm\vendor\laravel\framework\src\Illuminate\Container\Container.php:809
ReflectionClass::__construct("NecesssidadeSeeder")

this happen with any new Class

I solved this problem:

Change composer.json to

    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },

In the all Seeders File add the namespace

namespace Database\Seeders;

Change the folder database/seeds to

database/seeders

and run

composer dumpautoload

its work for me

Hi @augustosilveriosoares,

Thanks for reporting this and for using Creative Tim products. In case there is anything we can help with, please let us know.

Best,
UPDIVISION Team

Hi @augustosilveriosoares,

Hope this solved the issue. We will go ahead and close this ticket. If there is anything else we can help with, please let us know.

Best,
UPDIVISION Team

P.S. If you need help with any of your projects, we're happy to get in touch. We do custom development for start-ups and companies across the globe (you can check out our portfolio here https://updivision.com/portfolio and some happy clients over here https://updivision.com/testimonials). Don`t hesitate to drop us a line at office@updivision.com or by using our contact form (https://updivision.com/contact).