jeudi 3 août 2017

php - syntax error, unexpected 'list' (T_LIST), expecting identifier (T_STRING)

I understand that List is a reserved keyword for php, I had a model class called List then I changed the name to GroupingList, now I'm trying to seed my database table but I get the same error syntax error, unexpected 'list' (T_LIST), expecting identifier (T_STRING). I tried composer dumpautoload didn't help here's the seeder code

use Illuminate\Database\Seeder;

class RestaurantListSeeder extends Seeder
{

public function run()
{

    DB::table('restaurant_list')->delete();
    $restaurants_ids = DB::table('restaurant')->pluck('id');
    $grouping_ids = DB::table('grouping_list')->pluck('id');
    foreach ($restaurants_ids as $rest_id) {
        \App\RestaurantList::create([
            'restaurant_id' => $rest_id,
            "list_id" =>  $grouping_ids[0]
        ]);
    }
}
}

I'm not using list keyword anywhere in my model code, neither I do in my seeder code.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2wbtxw9
via IFTTT

Aucun commentaire:

Enregistrer un commentaire