Laravel seems to be throwing an error at line 3 use App\List;
but I can't seem to figure out the problem as I'm new to Laravel (perhaps it's a PHP version issue?).
Error:
syntax error, unexpected 'List' (T_LIST), expecting identifier (T_STRING)
Here is my PageController
Class:
<?php
use App\List;
namespace App\Http\Controllers;
class PageController extends Controller
{
public function home(){
$lists = List::all();
return view('home', compact('lists'));
}
}
and here is App\List
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class List extends Model
{
public function items(){
return $this->hasMany(ListItem::class);
}
}