In lumen5.5 i have implemented my factory method like this
$factory->define(App\CollegeEvent::class, function (Faker\Generator $faker) {
return [
'name' => randomElement(["Event1","Event2","Event4","Event3",]),
'slug' => $faker->email,
'category'=>randomElement(["Cat1","Cat2","Cat4","Cat3",]),
'problem_statement'=>$faker->paragraph(),
'description'=>$faker->paragraph(),
'name1'=>$faker->name,
'email1'=>$faker->email,
'contact1'=>$faker->address,
'name2'=>$faker->name,
'email2'=>$faker->email,
'contact2'=>$faker->address,
'faculty'=>$faker->name,
];
});
also my up() method for table blue print looks like this
public function up()
{
Schema::create('event', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('slug');
$table->string('category');
$table->string('problem_statement'); //problem statement for event
$table->text('description');
$table->string('name1'); //cordinator1
$table->string('email1');
$table->string('contact1',13);
$table->string('name2');//cordinator2
$table->string('email2');
$table->string('contact2',13);
$table->string('faculty');
$table->integer('count')->default(0);
$table->timestamps();
});
}
and in DatabaseSeeder.php i have
class DatabaseSeeder extends Seeder
{
public function run()
{
factory(CollegeEvent::class,10)->create();
}
}
I don't know whether these things are important for this error but i am getting following error on running
php artisan db:seed
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined methodIlluminate\Support\Facades\Event::newCollection()
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire