"Unexpected _data T_String" in Blade, Laravel

I followed Gerard Pois Laracas on his website and really studied, but, unfortunately, I made a mistake somewhere and I don’t know where it is. I get 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 am not quite sure why I am getting this problem. Can someone explain this to me please so that I can understand?

+6
source share
1 answer

I think you missed one quote on the last line. Try the following:

 <?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(); ?> 
+38
source

Source: https://habr.com/ru/post/971196/


All Articles