laravel select only some columns relationship

Solutions on MaxInterview for laravel select only some columns relationship by the best coders in the world

showing results for - "laravel select only some columns relationship"
Carlos
24 Jul 2019
1public function post()
2   {
3      return $this->hasMany(Post::class)->select(['id','user_id']);
4   }
5