minulhasanrokan/customer-social-finder

Find customer social profiles by name, profession, company, and location using Google Custom Search.

v1 2025-04-21 16:36 UTC

This package is auto-updated.

Last update: 2025-05-21 16:56:09 UTC


README

A Laravel package to help find social media profiles (LinkedIn, Facebook, Twitter) of a person based on their name, profession, company, and location β€” using the Google Custom Search API.

πŸš€ Features

  • 🧠 Accepts name, profession, company, and location as input
  • πŸ” Searches LinkedIn, Facebook, and Twitter using Google Custom Search
  • πŸ“· Displays title, link, snippet, and thumbnail (if available)
  • 🎨 Includes a ready-to-use Blade view

πŸ“₯ Installation

Step 1: Require via Composer

composer require minulhasanrokan/customer-social-finder

πŸ“‚ Publish Views (Optional)

To publish the default Blade view:

php artisan vendor:publish --tag=views

βš™οΈ Configuration

Step 1: Add Google API credentials to .env

GOOGLE_API_KEY=your_google_api_key
GOOGLE_CX_ID=your_custom_search_engine_id

Step 2: Update config/services.php

'google' => [
    'key' => env('GOOGLE_API_KEY'),
    'cx' => env('GOOGLE_CX_ID'),
],

πŸ”— Route Setup

You can add a route in your web.php to use the form:

use Minulhasanrokan\CustomerSocialFinder\Http\Controllers\SocialProfileController;

Route::match(['get', 'post'], '/social-finder', [SocialProfileController::class, 'index']);

πŸ–ΌοΈ Blade View Example

Here’s how the output is structured:

@foreach ($results as $result)
    <div class="profile-card">
        <h3>{{ $result['title'] }}</h3>
        <a href="{{ $result['link'] }}" target="_blank">{{ $result['link'] }}</a>
        <p>{{ $result['snippet'] }}</p>
        @if($result['image'])
            <img src="{{ $result['image'] }}" alt="Thumbnail">
        @endif
    </div>
@endforeach

πŸ” How to Get Google API Credentials

  1. Visit Google Cloud Console
  2. Create a new project
  3. Enable Custom Search JSON API
  4. Go to Programmable Search Engine
  5. Create a new search engine with sites like:
    *.linkedin.com, *.facebook.com, *.twitter.com
    
  6. Get your Search Engine ID (cx) and API key

🧾 Example Search Query

The search will build something like:

John Doe Software Engineer Acme Inc New York site:linkedin.com OR site:facebook.com OR site:twitter.com

This query is passed to Google’s Custom Search API.

πŸ›  Requirements

  • PHP ^8.0
  • Laravel ^10.0 || ^11.0 || ^12.0
  • Google Custom Search API credentials

πŸ“ Project Structure

src/ β”œβ”€β”€ Http/ β”‚ └── Controllers/ β”‚ └── SocialProfileController.php β”œβ”€β”€ resources/ β”‚ └── views/ β”‚ └── form.blade.php β”œβ”€β”€ routes/ β”‚ └── web.php └── CustomerSocialFinderServiceProvider.php

πŸ™‹ License

MIT License Β© Md. Minul Hasan