Support the ongoing development of Laravel.io →
Database Eloquent Packages

Hi, I am trying to use db:seed but every time I run it i get [Symfony\Component\Debug\Exception\FatalErrorException] syntax error, unexpected ';', expecting function (T_FUNCTION)

<?php

use Illuminate\Database\Seeder;

class UserTableSeeder extends Seeder
{

    public function run()
    {
        factory(App\User::class, 50)->create();
    }
}
<?php

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Model::unguard();

        $this->call('UserTableSeeder');

        Model::reguard();
    }
}

Can anyone tell me what is wrong with please? Cuz I wasted 2 ours for searching errors and there is still no result.

Last updated 2 years ago.
0

please post the full error trace. it's possible that you have missed a } somewhere.

0

astroanu

This is the full stack! The point is that there are so little info in console that I can't even figure out what a hack is going on.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Kizlo kizlo Joined 8 Dec 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.