Skip to content

Commit 20c5dee

Browse files
committed
initial commit
0 parents  commit 20c5dee

File tree

6 files changed

+1487
-0
lines changed

6 files changed

+1487
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/vendor/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Noud de Brouwer
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Laraval Google Indexing API
2+
3+
Inform Google Search [Indexing API](https://developers.google.com/search/apis/indexing-api/v3/quickstart) about your [Job Posting](https://developers.google.com/search/docs/data-types/job-posting) URLs.
4+
5+
## Requirements
6+
7+
* PHP 7.2+
8+
* Laravel 5.6+
9+
10+
## Installation
11+
12+
1) Install the package by running this command in your terminal/cmd:
13+
```
14+
composer require noud/laravel-google-indexing-api
15+
```
16+
17+
## Use
18+
19+
Here is a usage example:
20+
```
21+
<?php
22+
23+
namespace App\Http\Controllers;
24+
25+
use App\Models\JobPosting;
26+
use GoogleIndexing\Services\IndexingService;
27+
28+
class GoogleIndexingController extends Controller
29+
{
30+
private $indexingService;
31+
32+
public function __construct(IndexingService $indexingService)
33+
{
34+
$this->indexingService = $indexingService;
35+
}
36+
37+
public function updateURL(JobPosting $jobPosting)
38+
{
39+
$this->indexingService->publish($jobPosting->url, "URL_UPDATED");
40+
}
41+
42+
public function removeURL(JobPosting $jobPosting)
43+
{
44+
$this->indexingService->publish($jobPosting->url, "URL_DELETED");
45+
}
46+
47+
public function statusURL(JobPosting $jobPosting)
48+
{
49+
$this->indexingService->status($jobPosting->url;
50+
}
51+
}
52+
```

composer.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "noud/laravel-google-indexing-api",
3+
"description": "Laravel Google Search Indexing API",
4+
"type": "library",
5+
"require": {
6+
"php": ">=7.2.0",
7+
"pulkitjalan/google-apiclient": "^4.0@dev"
8+
},
9+
"license": "MIT",
10+
"authors": [
11+
{
12+
"name": "Noud de Brouwer",
13+
"email": "[email protected]"
14+
}
15+
],
16+
"minimum-stability": "dev",
17+
"prefer-stable": true,
18+
"autoload": {
19+
"psr-4": {
20+
"GoogleIndexing\\": "src/"
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)