Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel 5.2 blade template failing to parse

I have an issue with a laravel 5.2 site I'm working on. I have a master (main) layout that I'm using to set the main elements of the page up, and it's being used in the welcome page (that extends it) with no problem.

However, in some of the subpages I keep getting an error from the compiled view:

<?php echo $__env->make('layouts.main, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

The error is Parse error: syntax error, unexpected '__data' (T_STRING), expecting ',' or ')'

There's literally nothing in my view except the title and the main content element, where I'm trying to dump a variable. The error is coming from Laravel, not my code (as far as I can tell).

This is the whole view:

@extends('layouts.main)

@section('title', 'another page!')

@section('content')
{{dd($myvar)}}
@endsection

Any ideas why this is happening?

like image 740
user101289 Avatar asked Aug 23 '16 05:08

user101289


2 Answers

Please check the first line:

@extends('layouts.main)

The closing single quote (') is missing. It should be:

@extends('layouts.main')
like image 56
Ravi Shankar Avatar answered Nov 19 '22 02:11

Ravi Shankar


Use this as your first line:

@extends('layouts.main')

We often forget to put ' on last word. Happens!

like image 3
ashokchhetri Avatar answered Nov 19 '22 02:11

ashokchhetri