php - Laravel 5: DB Seed class not found -


i have databaseseeder.php:

<?php  use illuminate\database\seeder; use illuminate\database\eloquent\model;        class databaseseeder extends seeder {          /**          * run database seeds.          *          * @return void          */         public function run()         {             model::unguard();              $this->call('memberinvitationseeder');         }     } 

i have file memberinvitationseeder.php, sibling databaseseeder.php file

<?php  use illuminate\database\seeder; use app\memberinvitation;      class memberinvitationseeder extends seeder {          public function run()         {             memberinvitation::truncate();              memberinvitation::create( [                 'id' => 'blahblah' ,//com_create_guid(),                 'partner_id' => 1,                 'fisrt_name' => 'thats',                 'last_name' => 'me',                 'email' => 'me@mymail.com',                 'mobile_phone' => '444-342-4234',                 'created_at' => new datetime             ] );          }     } 

now call

php artisan db:seed 

and get:

[reflectionexception]                           class memberinvitationseeder not exist 

i tried find including "composer dump-autoload". no avail. doing wrong?

php artisan make:seed memberinvitationseeder 

in databaseseeder.php add line in run method:

$this->call(memberinvitationseeder::class); 

after eventually

composer dump-autoload 

and:

php artisan db:seed 

this should work

if isn't clue, check file composer.json nad make sure have code in "autoload" section:

"classmap": [     "database" ], 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -