Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

Query Builder for Beginner In Laravel

1.Find Unique column and avoid duplicate column

3 method using distinct, groupby, pluck command



In above table triptitle field land of rising sun and windy city r unique land of rising 3 times repeated

2 Find unique record

$categories = Rvsp::distinct()->get();

3.count total no of rows

here total 4 rows are there

$Trips = DB::table(‘rvsps’)
return $Trips;

count{{$Trips}} in blade file

4.display unique field and their total no of entries

here trip title Land of the Rising Sun 3 times entry in table triptitle Windy City one times see in below table mentioned in screenshot image

$touroperator = Rvsp::where(‘TripTitle’,$TripTitle)->latest()->paginate(20);
->select(‘TripTitle’, DB::raw(‘COUNT(TripTitle) as total_member’))
->havingRaw(‘COUNT(TripTitle) > 0’)

5.display particular colunm that is requested in blade file

first check requested value in blade file

$tour->TripTitle is requested

requested value is land of rising sun

now find total record of requested value using this query
$touroperator = Rvsp::where(‘TripTitle’,$TripTitle)->latest()->paginate(20);

6.display particular colunm that is present in another table based on condition

display all city of india

here three table city,state,country is present

Firstly retrive all state from state table that is under india where india id is 101 using pluck command

  $states = State::where(‘states.country_id’,’101′)->get();

then pass this variable to where condition to match all cities that is under india state

 $city = DB::table(‘cities’)->whereIn(‘cities.state_id’, $states)->get();

Latest posts by Rakesh Dev (see all)