The following would display test[0]'s id .
{{ Session::get('test')[0] ['id']}}
If you want all the values displayed, then use a @foreach:
@foreach(Session::get('test') as $test)
{{$test['id']}}
@endforeach
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
My controller
class RedirectController extends Controller
{
public function admin(){
$test = DB::table('PAGE_TBL')->get();
Session::put('test', $test);
return view('admin');
}
}
My View Blade
<div>
{{ Session::get('test') }}
</div>
It Display result as
[{"id":1,"name":"Kaustubh","created_at":null,"updated_at":null}]
But i want to fetch a single value from that array, i tried many things to fetch a particular value but it didnt work.
Please or to participate in this conversation.