eloquent - How to select one column clumn from table and all records from relation table [Laravel 5] -


i have eloquent query this:

project::with('tasks')->get([]); 

i need take projects table 1 coulmn 'name' , tasks wana all...

anyone know how acomplish it?

in order able load tasks, need load project's id:

$projects = project::with('tasks')->get(['id', 'name']); 

Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -

javascript - How to change image src on success AJAX -