View Json Value In laravel View :
Controller file :
public function index()
{
//
$students = Student::get()->toJson(JSON_PRETTY_PRINT);
// return response($students, 200);
return view('student.List')->with('students', json_decode($students,true));
}
View File :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
@foreach($students as $students)
<tr class="odd pointer">
<td class=" ">{{$students["id"]}}</td>
<td class=" ">{{$students["name"]}}</td>
</tr>
@endforeach
</body>
</html>