Turn Your Vehicle Into a Smart Earning Asset

While you’re not driving your car or bike, it can still be working for you. MOTOSHARE helps you earn passive income by connecting your vehicle with trusted renters in your city.

πŸš— You set the rental price
πŸ” Secure bookings with verified renters
πŸ“ Track your vehicle with GPS integration
πŸ’° Start earning within 48 hours

Join as a Partner Today

It’s simple, safe, and rewarding. Your vehicle. Your rules. Your earnings.

Query Builder for Beginner In Laravel

1.Find Unique column and avoid duplicate column

3 method using distinct, groupby, pluck command

OR

OR

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’)
->select(‘TripTitle’)
->distinct()->count();
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’))
->groupBy(‘TripTitle’)
->havingRaw(‘COUNT(TripTitle) > 0’)
->get();

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();

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.