I\'m new at Laravel and not good with syntax. I want to see the values of another table through the foreign key(id of that table).
https://ibb.co/pXRFRHn You can see in
All you have to do is
data-myclassid="{{$cat->class_id}}"
rather than this try this
data-myclassid="{{ \Illuminate\Support\Facades\DB::table('class')->where('id',$cat->class_id)->value('name')}}"
I am assuming that your table name is class as you want to show class name so in that database class name (column name) would be simple 'name' , that why I put name in value field....