php - Laravel's Model Factory throwing syntax error -
i have tried using factory create number of users through use of stock migration/model/factory definition , following command ran within php artisan tinker: $user = factory(app\user::class)->make();
i have made no changes function can see below;
$factory->define(app\user::class, function (faker\generator $faker) { return [ 'name' => $faker->name, 'email' => $faker->safeemail, 'password' => bcrypt(str_random(10)), 'remember_token' => str_random(10), ]; });
yet following error: [symfony\component\debug\exception\fatalthrowableerror] parse error: syntax error, unexpected '->' (t_object_operator), expecting']'
update
i must have deleted somewhere along line caused error, have no idea started fresh project , no longer have error. thankyou trying help!
what happens if wrap factory call in parentheses, object operator after? though, expecting closing ]
makes me think have forgotten one, further not you're looking.
Comments
Post a Comment