Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel select only some columns relationship

public function post()
   {
      return $this->hasMany(Post::class)->select(['id','user_id']);
   }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #select #columns #relationship
ADD COMMENT
Topic
Name
9+6 =