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

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -