Lalit's avatar
Level 1

Laravel - Load common header and footer to view

Laravel - Load common header and footer to view

public function shownotification(Request $request)

{ $userId = Auth::id();

   $shown = DB::table('notification')
  ->join('users', 'users.id', '=', 'notification.sender_id')
  ->where('notification.receiver_id', $userId)->first();

  //echo "<pre>"; print_r($shownotif); die();

  $value = Request::header('Content-Type');


    return view(@include('includes/header'),['shown'=>$shown]));

      

}

0 likes
7 replies
meysam1366's avatar

return view('includes.header',compact('shown')));

1 like
Lalit's avatar
Level 1

ErrorException in ff7abd237336be38eb1acbd74dd6da12db02c071.php line 7: Undefined variable: shown (View: /var/www/html/geonback/resources/views/includes/header.blade.php) (View: /var/www/html/geonback/resources/views/includes/header.blade.php) (View: /var/www/html/geonback/resources/views/includes/header.blade.php)

Getting this error Sir

Lalit's avatar
Level 1

i Have define in code source of header file in other work fine but in header getting error

Please or to participate in this conversation.