samedi 6 avril 2019

How to see table fields from foreign keys in Laravel

I'm new at Laravel and not good with syntax. I want to see the values of other table through foreign key(id of that table).

I am having two table user and class. I use class_id as foreign key in user table.

Now when I try to show data I see the id, but I want the name & other fields extracted from that id.

As I m using it with buttons:

<button class="btn btn-info" data-mytitle="" data-myclassid=""   data-catid= data-toggle="modal" data-target="#edit">Edit</button>

Specifically

myclassid=""

from this I get class id but I want its name also, I have tried

myclassid=""

but it didn't work.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire