Widyan Fakhrul Arifin
Widyan Fakhrul Arifin

Reputation: 47

How to show data Laravel?

This is my script code in Laravel:

<?php
$surat_masuk = DB::table('app_suratmasuk')->where('disposisi','like','%**{{ Session::get('fid') }}**%')->count(); 
?>

<span class="notif-alert ">{{ $surat_masuk }}</span>

I know , I have a mistake when adding {{ Session::get('fid') }}. I want to ask, how to write that code to show {{ Session::get('fid') }} because this script is in PHP syntax under PHP script.

Upvotes: 1

Views: 124

Answers (1)

Andrej
Andrej

Reputation: 7504

Use the following code:

$surat_masuk = DB::table('app_suratmasuk')
     ->where('disposisi','like', '%' . Session::get('fid') . '%')->count(); 

Upvotes: 1

Related Questions