I am displaying my data using datatable, if empty array then datatable will not be shown.
I tried
@if(count($results) > 0)
//data show
@foreach($results as $r)
<p>{{$r->name}}</p>
@endfor
@else
No result found.
@endif
//
// $results is an array
This will return error if empty $result. How can i make it if $result is empty then show the custom message and not to display DataTable.