mardi 31 mars 2020

How to use select function and with function together in laravel

I want to select some column from the main table with laravel with function but when I use select it gives null in with for example

table1::select('column1','column2')->with(['table2'])->paginate($request->query('per_page', 10));

If I use select then it gives null in table2 but if I remove the select then it gives values in table2.

Can anyone please let me know what I am doing wrong or what can be done here



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2UwgG5O
via IFTTT

Aucun commentaire:

Enregistrer un commentaire