Introduction
When youโre running a business, trust is everything. And what better way to build trust than by showcasing your verified Google reviews directly on your website?
Think about it: visitors already Google your company before doing business with you. By displaying real customer reviews from your Google Business Profile right inside your Laravel-powered website, you instantly boost credibility, conversions, and SEO rankings.
But hereโs the challenge: Google doesnโt give you a simple copy-paste widget anymore. To do this properlyโand securelyโyouโll need to use the Google Places API. Donโt worry, though. In this guide, Iโll walk you through everything: from getting your API key to fetching and displaying reviews dynamically in Laravel.
By the end of this tutorial, youโll have a fully working solution that makes your website look professional, trustworthy, and conversion-ready.
Why Show Google Reviews on Your Laravel Website?
Before diving into the code, letโs understand why this matters:
- Trust at first glance โ Prospective clients donโt just take your word for it. They want proof. Google reviews provide exactly that.
- SEO advantage โ Google loves when businesses integrate their ecosystem. Embedding reviews can positively impact your siteโs relevance and authority.
- Conversion boost โ Social proof is one of the strongest conversion drivers. A 5-star badge with verified testimonials can tilt buying decisions in your favor.
- Consistency โ Instead of manually copying reviews, this integration keeps your website updated automatically.
Step 1: Set Up a Google Cloud Project
To use the Google Places API, youโll first need to create a Google Cloud project:
- Go to the Google Cloud Console.
- Create a new project and give it a meaningful name (e.g., โLaravel Reviews Integrationโ).
- Enable Places API from the API library.
- Generate an API Key.
โก Pro Tip: Create a separate Server Key (not a browser key), since Laravel will be making server-side requests.
Step 2: Find Your Google Place ID
Every business profile is tied to a unique Place ID. Youโll need this to fetch reviews.
- Go to Google Place ID Finder.
- Search your business name (e.g., Ramlit Limited).
- Copy the
place_id
.
Keep it safeโyouโll need it in .env
.
Step 3: Store Keys Securely in Laravel
Open your .env
file and add:
GOOGLE_PLACES_API_KEY=your_api_key_here
GOOGLE_PLACE_ID=your_place_id_here
GOOGLE_REVIEWS_CACHE_HOURS=12
This ensures sensitive credentials arenโt hardcoded.
Step 4: Create a GooglePlaces Service in Laravel
In app/Services/GooglePlaces.php
:
<?php
namespace App\Services;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
class GooglePlaces
{
public function details(): array
{
$ttlHours = (int) config('services.google_places.cache_h', 12);
return Cache::remember('google.place.details', now()->addHours($ttlHours), function () {
$resp = Http::get('https://maps.googleapis.com/maps/api/place/details/json', [
'place_id' => config('services.google_places.place_id'),
'fields' => 'name,rating,user_ratings_total,reviews',
'key' => config('services.google_places.api_key'),
])->json();
if (($resp['status'] ?? '') !== 'OK') {
return ['name' => null, 'rating' => null, 'total' => 0, 'reviews' => []];
}
$r = $resp['result'];
return [
'name' => $r['name'] ?? 'Google Reviews',
'rating' => $r['rating'] ?? null,
'total' => $r['user_ratings_total'] ?? 0,
'reviews'=> collect($r['reviews'] ?? [])->map(fn ($rev) => [
'author' => $rev['author_name'] ?? 'Google user',
'profile' => $rev['author_url'] ?? null,
'rating' => $rev['rating'] ?? null,
'text' => $rev['text'] ?? '',
'time' => $rev['relative_time_description'] ?? '',
])->toArray(),
];
});
}
}
โ This service fetches your reviews, formats them neatly, and caches them for performance.
Step 5: Update Controller
Inside your PageController.php
:
use App\Services\GooglePlaces;
public function index(Request $request, GooglePlaces $places)
{
$reviews = $places->details();
$placeId = config('services.google_places.place_id');
$googleReviewsUrl = 'https://www.google.com/maps/place/?q=place_id:' . $placeId;
$googleWriteUrl = 'https://search.google.com/local/writereview?placeid=' . $placeId;
return view('ramlit-limited.pages.index', [
'reviews' => $reviews,
'googleReviewsUrl' => $googleReviewsUrl,
'googleWriteUrl' => $googleWriteUrl,
]);
}
Step 6: Blade Template for Reviews
Now, letโs make it look good.
<section class="google-reviews">
<div class="container">
<div class="section-title">
<h5>What Clients Say</h5>
<h2>Trusted Worldwide โ Verified Google Reviews</h2>
<p>โญ {{ $reviews['rating'] }} ({{ $reviews['total'] }} Google Reviews)</p>
</div>
<div class="reviews-carousel swiper-container">
<div class="swiper-wrapper">
@foreach($reviews['reviews'] as $review)
<div class="swiper-slide">
<div class="testimonial-card">
<h3>{{ $review['author'] }}</h3>
<span>{{ $review['time'] }}</span>
<div class="rating-box">
@for($i = 0; $i < $review['rating']; $i++)
<i class="fa fa-star"></i>
@endfor
</div>
<p>{{ $review['text'] }}</p>
</div>
</div>
@endforeach
</div>
</div>
<div class="review-actions">
<a href="{{ $googleReviewsUrl }}" class="btn btn-primary" target="_blank">See All Google Reviews</a>
<a href="{{ $googleWriteUrl }}" class="btn btn-secondary" target="_blank">Write a Review</a>
</div>
</div>
</section>
โ Fully dynamic. โ Styled to match your theme. โ Trustworthy.
Clear Cache and Test
php artisan config:clear
php artisan cache:clear
php artisan view:clear
Reload your homepage. You should see your verified Google reviews beautifully displayed.
Extra Tips for Production
- Limit API usage โ Google Places API is paid after a free tier. Use caching (
Cache::remember
) wisely. - Secure API keys โ Always restrict your API key to IP addresses.
- Fallbacks โ If the API fails, show a default message instead of breaking the layout.
- Styling โ Match your brand identity (colors, fonts, animations).
Bullet Points / Quick Takeaways
- Google Reviews = trust + SEO boost
- Use a Server Key for Laravel (not browser key)
- Get your Place ID from Googleโs Place Finder
- Store credentials in
.env
securely - Cache responses to save API calls
- Add โSee All Reviewsโ and โWrite a Reviewโ buttons for UX & trust
Call to Action (CTA)
๐ Ready to win more clients? Start integrating your Google Business Profile reviews into your Laravel site today. Itโs one of the easiest, most powerful upgrades you can make for credibility and conversions.
Optional FAQ Section
Q: Is Google Places API free? A: Google offers a free tier with $200 monthly credits. Most small sites fit comfortably within this.
Q: Can I filter reviews (e.g., only 5-star)? A: Yes. You can filter reviews inside the service before sending them to your view.
Q: Do I need a Google Maps billing account? A: Yes, you must enable billing to use Places APIโeven if you stay under the free quota.
Q: Can reviews auto-update? A: Yes. With caching, you can refresh reviews every few hours without hitting API limits.