get a particular columns using model in laravel eloquent code example
Example 1: get specific columns using with() function in laravel eloquent
Post::with('user:id,username')->get();
Example 2: model find by certain column laravel
Table::select('name','surname')->where('id', 1)->get();