I have a very simple setup in Laravel while I'm learning it and I can't figure why I'm getting an error. It's probably something simple I am overlooking.
I can get this:
Route::get('users', function() {
$users = User::all();
return View::make('users')->with('users', $users);
});
example on Laravel to work perfectly, displaying this information in a users.blade.php view.
In my database I also have a 'lists' table but when I copy the structure of the code above to try and display my lists I receive the following error.
syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM), expecting '('
on line
$lists = list::all();
My code is as follows routes.php
Route::get('lists', function() {
$lists = list::all();
return View::make('lists')->with('lists', $lists);
});
list.php /models
<?php
class List extends Eloquent {}
lists.blade.php /views
@extends('layouts.main')
@section('content')
@foreach($lists as $list)
<p>{{ $list->name }}</p>
@endforeach
@stop
Any help would be much appreciated. Thanks.
$lists = List::all();