Answers for "HP Fatal error: Call to undefined function factory() in Psy Shell code on line 1"

1

Call to undefined function factory() in Psy Shell code on line 1

In Laravel 8, the factory helper is no longer available. Your Thread model 
class should use `HasFactory` trait, then you can use your factory like this:

Thread::factory()->count(50)->create();

For more : https://laravel.com/docs/8.x/database-testing#creating-models
Posted by: Guest on September-20-2020
0

PHP Fatal error: Call to undefined function factory() in Psy Shell code on line 1, LARAVEL 8 Issue solved

$ php artisan tinker
>>> User::factory()->count(100)->make();
Posted by: Guest on June-03-2021

Code answers related to "HP Fatal error: Call to undefined function factory() in Psy Shell code on line 1"

Browse Popular Code Answers by Language