dimanche 2 décembre 2018

Retrieve all the parent value with Laravel Eloquent

After user login I would like to fetch all the details of the user logged in from it's multiple parent table like user details, it's parent details, allowed access control etc.

Relation ship is like

-> User Credential table -> User Details -> Company Details.
 -> User Details -> Access Control List (Mapping) -> Menu Master
 -> User Details -> Notification Details (Mapping)-> Notification Master

Now from user credential model I have pointed with hasOne relation ship with user details model.

In User Details model I have method to access company table,Menu mapping table and Notification Mapping table.

Now what I want that when I fetch the user details all the parent records (upto any level will be loaded and returned to me).

Need help the process to do the same.

Note: I have already been able to fetch the records from user details table with mapping from logged in user.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire