Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unexpected _data T_String" in Blade, Laravel [closed]

Tags:

php

laravel-4

I was following along with Jeffrey Ways laracasts on his website and was really learning but unfortunately I made an error somewhere and I don't know where that is. I am receiving the following error.

https://laracasts.com/series/laravel-from-scratch

Symfony \ Component \ Debug \ Exception \ FatalErrorException

syntax error, unexpected '__data' (T_STRING)

<?php $__env->startSection('content'); ?>
<h1>All Users</h1>
<?php foreach($users as $user): ?>
<li><?php echo link_to("/users/{$user->username}", $user->username); ?></li>
<?php endforeach; ?>;
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.default, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

I'm not quite sure why I am getting this issue. Can someone explain it to me please so I can understand?

like image 512
user3732216 Avatar asked Jun 23 '14 03:06

user3732216


1 Answers

I think you missed a single quote on the last line. Try this:

<?php $__env->startSection('content'); ?>
<h1>All Users</h1>
<?php foreach($users as $user): ?>
<li><?php echo link_to("/users/{$user->username}", $user->username); ?></li>
<?php endforeach; ?>;
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.default', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
like image 172
josh Avatar answered Nov 16 '22 00:11

josh