You can use Laravel’s pluck
method as:
$sellers = Seller::with('user')->get()->pluck('user.first_name', 'id')
More Related Contents:
- How to Merge Two Eloquent Collections?
- Natural ORDER in Laravel Eloquent ORM
- Laravel collection converts array to object
- Laravel 5.1, Return response to user, then excute some code [closed]
- Laravel – only a zero is saved to the database
- Post request in Laravel – Error – 419 Sorry, your session/ 419 your page has expired
- How Can I Remove “public/index.php” in the URL Generated Laravel?
- How to pass data to all views in Laravel 5?
- Laravel: Error [PDOException]: Could not Find Driver in PostgreSQL
- Laravel: PDOException: could not find driver
- Composer error: “PHP extension fileinfo is missing from your system”
- Laravel: How can I change the default Auth Password field name?
- No Application Encryption Key Has Been Specified
- Laravel pagination pretty URL
- Laravel OrderBy relationship count
- How to change / Custom password field name for Laravel 4 and Laravel 5 user authentication [duplicate]
- Laravel: Using try…catch with DB::transaction()
- Laravel 5 Class ‘form’ not found
- How to set a default attribute value for a Laravel / Eloquent model?
- Order By before Group By using Eloquent (Laravel)
- Laravel Socialite: InvalidStateException
- how to fix stream_socket_enable_crypto(): SSL operation failed with code 1
- Laravel – How to get current user in AppServiceProvider
- Laravel and view caching in development — can’t see changes right away
- The requested URL /ProjectName/users was not found on this server. Laravel
- How to install all required PHP extensions for Laravel?
- How to send data using redirect with Laravel
- Laravel Carbon Data Missing
- Avoid public folder of laravel and open directly the root in web server
- Laravel Eloquent update just if changes have been made