I am new to laravel and I have been trying to store all records of table \'student\' to a variable and then pass that variable to a view so that I can display them.
You can try this as well:
public function showstudents(){ $students = DB::table('student')->get(); return view("user/regprofile", ['students'=>$students]); }
Also, use this variable in your view.blade file to get students name and other columns:
view.blade
{{$students['name']}}