Reputation: 852
Here's my controller code:
public function getIndex()
{
\Eloquent::unguard();
$users = \DB::table('users')->get();;
return \View::make('index')->with('users', $users);
}
So nothing fancy whatsoever.
In my view I am displaying the data from the users table:
@foreach ($users as $user) {
{{$user->email}}
}
@endforeach
But it seems that all of my output has {}
around each iteration, like this:
{ John } { [email protected] }
I'm not sure what is going on and why these brackets are appearing around all of my output or how to get rid of them.
Upvotes: 2
Views: 2662
Reputation: 219910
Blade doesn't use curly braces for control flow. Just remove them:
@foreach ($users as $user)
{{ $user->email }}
@endforeach
Upvotes: 5