I have started developing a new website with Laravel and AngularJS.
When I create my UserTable I want to populate it with some values using php artisan db:seed
, but I get the following message:
[Symfony\Component\Debug\Exception\FatalErrorException] parse error, expecting `')''
Here is my code for DatabaseSeeder.php
<?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');
$this->command->info('User Table seeded');
Model::reguard();
}
}
and UserTableSeeder.php
<?php
class UserTableSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('users')->delete();
User::create(array(
'first_name' => 'Thomas',
'last_name' => 'ERAUSQUIN',
'email' => 'te@et-project.net',
'username' => 'etadmin',
'password' => Hash::make('test'); //hashes our password nicely for us
));
}
}
I have already tried running composer dump-autoload
Thank you in advance for your help.