Hello, Developer
Here you see that how to Pluck data from Database in laravel by pluck method this is one of the simplest method to get specific column data trough to specify the name of the column it is very simple to learn as well as find out data from database using pluck method.
Whene you using pluck method at that time put that name which you want to get column it will show output array and whenever you put the name of the column and id in pluck method you will get the name of the column with id and that id become key of that name of a column, here webappfix below give an explanation with example do according to below example and you will get output from laravel pluck method.
Pluck method is a part of laravel it will retrieving a list of data from database in specify list and value given $array.
It is mostly using while compair in_array() two array and want's to unique result that time mostly used.
So, Here I will guide you step by step how to use Pluck method in laravel.
Example 1 : Controller
App/http/controller/dashboardController
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use User; class dashboardController extends Controller { $data = User::pluck('id','email'); dd($data); }
Output
array = [ 1 => abc@gmail.com, 2 => xyz@gmail.com, 3 => qwe@gmail.com ];
Without pluck id it will generate auto key.
jQuery load more data on scroll
Example 2 : Controller
App/http/controller/dashboardController
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use User; class dashboardController extends Controller { $data = User::pluck('email'); dd($data); }
array = [ 0 => abc@gmail.com, 1 => xyz@gmail.com, 2 => qwe@gmail.com ];
We always thanks to you for reading our blogs.

Dharmesh Chauhan
(Swapinfoway Founder)Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us

Haresh Chauhan
(Co-Founder)We Are Also Recommending You :
- Create Custom Route File With New Service Provider Laravel 8 9
- How to use Date Format Validation in Laravel?
- How to Create Zip File and Download in Laravel
- Error : The MAC is invalid Question's And Solutions [Solved]
- Laravel 9 Sanctum API Authentication Tutorial
- Queue Laravel Command Tutorial Example
- How To Configuration Laravel Supervisor
- Laravel Scope With Example Usage
- could not encode content to iso-8859-1
- Non-static method Illuminate\Http\Request::method() should not be called statically