PHP code example of noud / laravel-seo-google-indexing-api

1. Go to this page and download the library: Download noud/laravel-seo-google-indexing-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

noud / laravel-seo-google-indexing-api example snippets




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