I put the code in and got this error
class ListingFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
'title' => $this->faker-> sentence(),
// 'tags' => 'Laravel, API, Backend',
// 'company' => $this->faker()->company(),
// 'location' => $this->faker()->city(),
// 'email' => $this->faker()->companyemail(),
// 'website' => $this->faker()->url(),
// 'description' => $this->faker()->paragraph(5),
];
}
}
ParseError
syntax error, unexpected token "&"
at database\factories\ListingFactory.php:20 16▕ */ 17▕ public function definition() 18▕ { 19▕ return [ ➜ 20▕ 'title' => $this->faker-> sentence(),
Commented out several lines just trying to limit until I get some code working
@rkellogg12 I see in your code that you have a ->
(the html attribute) and not the arrow -> that result in the error. If you change it I suspect that it will work.
Ps. I have updated your posts to have clear codeblocks.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community