Laravel - Relationships - Eager Loading Specific Columns

You may not always need every column from the relationships you are retrieving. For this reason, Eloquent allows you to specify which columns of the relationship you would like to retrieve:

    
    $books = Book::with('author:id,name,book_id')->get();
	
When using this feature, you should always include the id column and any relevant foreign key columns in the list of columns you wish to retrieve.