noud / laravel-seo-google-indexing-api
Laravel SEO Google Search Indexing API
Installs: 7 525
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 4
Open Issues: 3
Requires
- php: >=7.2.0
- pulkitjalan/google-apiclient: ^4.0@dev
This package is auto-updated.
Last update: 2024-11-12 00:48:44 UTC
README
Inform Google Search Indexing API about your Job Posting URLs.
Requirements
- PHP 7.2+
- Laravel 5.6+
Installation
Install the package by running this command in your terminal/cmd:
composer require noud/laravel-seo-google-indexing-api
Configuration
Add these settings to your .env
.
GOOGLE_SERVICE_ENABLED=true
GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION="/var/www/seo/config/google/google-service-account.json"
Usage
Here is a usage example:
<?php
namespace App\Http\Controllers;
use App\Models\JobPosting;
use GoogleIndexing\Services\IndexingService;
class GoogleIndexingController extends Controller
{
private $indexingService;
public function __construct(IndexingService $indexingService)
{
$this->indexingService = $indexingService;
}
public function updateURL(JobPosting $jobPosting)
{
$this->indexingService->update($jobPosting->url);
}
public function removeURL(JobPosting $jobPosting)
{
$this->indexingService->remove($jobPosting->url);
}
public function statusURL(JobPosting $jobPosting)
{
$this->indexingService->status($jobPosting->url);
}
}