Sunday 15 April 2012

Laravel 5 class DatabaseSeeder not found when running php Artisan db:seed -


I am new to Laravel, when I run php artisan db: seeds i get the following message:

[ReflectionException] Class database cursor is not present

I have already dumped-out a music composer without any consequence. My square default folder / Seeds are located in

class by code:

  & lt ;? Php namespace database \ seeds; Use Illuminate \ Database \ Seeder; Illuminated \ database \ supernatural \ models use; Use the app \ user; Use the app \ country; Square database extends cedar cedar {/ ** * Run the database seeds. * * @ReturnWide * / Public Function Run () {Model: Unguard (); $ This- & gt; Phone ('CountryTableSeeder'); $ This- & gt; Phone ('UserTableSeeder'); }} Category UserTableSeeder Seeder {Run Public Function () {DB :: Table ('User'); User :: Create (['username' = & gt; 'Bart', 'email' = & gt; 'bart@example.com', 'password' = & gt; hash :: create ('password')] ); }} Category Country Tablescards More Cedar {Public Function Run () {DB :: table ('country') is expanded; Country :: Create (['country_name' = & gt; 'Niederlander']); }}  

What am I doing wrong?

First you namespace database \ bias; should be removed as Jokodar has suggested the comment.

And the other thing is that you should not put many sections in one file (as you probably were seeing your question). Each category should be kept in separate file.


No comments:

Post a Comment