0
votes

Here is my Controller code:

 public function method(Request $request){
   $typeType = $request->type; //this variable show 'Booking'

   return view('home.profile',compact('type'));
 }

Here is blade file :

 @extends('layouts.dashboard')
 @section('page_heading',{{$taskType}})
 @section('section')
    //here some code
 @stop

if I use this blade code. then I have got this problem:

Parse error: syntax error, unexpected '<' (View:resources/view/home/profile.blade.php)

if I use this code on blade

 @extends('layouts.dashboard')
 @section('page_heading','{{$taskType}}')
 @section('section')
    //here some code
 @stop

then blade file display it:

<?php echo e($taskType); ?>

I want to display it on blade file:

 Booking

How can I solve this problem?

2
You named the variable $task, not $taskType - Derek Pollard
yes, I'm changing but also show error. - Shohidur Rahman

2 Answers

2
votes

Probably you don't need {{ }} inside a Blade Directive.

So change that to:

 @section('page_heading', $taskType)
0
votes
public function method(Request $request){
   $typeType = $request->type; //this variable show 'Booking'

   return view('home.profile')->with(['taskType' => $typeType]);
 }