Skip to content

Commit 51a6f05

Browse files
author
schulzefelix
committed
Laravel 9 support
1 parent 9a55418 commit 51a6f05

File tree

4 files changed

+39
-19
lines changed

4 files changed

+39
-19
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22

33
All Notable changes to `laravel-search-console` will be documented in this file.
4+
## [1.8.0] - 2022-03-11
5+
- Add Compatibility With Laravel 9
6+
- Drop support for Laravel 8
7+
- Minimum PHP 8.0.2
8+
- Drop Support for Laravel Lumen
9+
410
## [1.7.1] - 2021-04-11
511
- Add 'AggregationType' request and response parameter
612

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,20 @@
1010

1111
Using this package you can easily retrieve data from Google Search Console API.
1212

13-
## Install
13+
Here are a few examples of the provided methods:
14+
15+
```php
16+
use SearchConsole;
1417

15-
> For Laravel 5.8, use version 1.2.0 of this package!
18+
//list all available sites for that token
19+
SearchConsole::setAccessToken($token)->listSites();
20+
21+
//get site details (permissionLevel) for specific site
22+
SearchConsole::setAccessToken($token)->getSite('http://blog.example.com/');
23+
```
24+
25+
26+
## Install
1627

1728
This package can be installed through Composer.
1829

@@ -105,6 +116,9 @@ $sites = SearchConsole::setAccessToken($token)->listSites();
105116
### Search Analytics
106117

107118
```php
119+
use SearchConsole;
120+
use SchulzeFelix\SearchConsole\Period;
121+
108122
$data = SearchConsole::setAccessToken($token)->setQuotaUser('uniqueQuotaUserString')
109123
->searchAnalyticsQuery(
110124
'https://www.example.com/',

composer.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020
}
2121
],
2222
"require": {
23-
"php": "^7.3|^8.0",
23+
"php": "^8.0.2",
2424
"google/apiclient": "^2.0",
25-
"illuminate/support": "^8.0",
26-
"symfony/cache": "^4.3|^5.0"
25+
"illuminate/support": "^9.0",
26+
"symfony/cache": "^6.0"
27+
2728
},
2829
"require-dev": {
29-
"mockery/mockery": "^1.4.2",
30-
"orchestra/testbench": "^5.0|^6.0",
31-
"phpunit/phpunit" : "^8.0|^9.0"
30+
"mockery/mockery": "^1.4",
31+
"orchestra/testbench": "^7.0",
32+
"phpunit/phpunit": "^9.4"
3233
},
3334
"autoload": {
3435
"psr-4": {
@@ -52,5 +53,7 @@
5253
},
5354
"config": {
5455
"sort-packages": true
55-
}
56+
},
57+
"minimum-stability": "dev",
58+
"prefer-stable": true
5659
}

src/SearchConsoleServiceProvider.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
namespace SchulzeFelix\SearchConsole;
44

5-
use Illuminate\Foundation\Application as LaravelApplication;
65
use Illuminate\Support\ServiceProvider;
7-
use Laravel\Lumen\Application as LumenApplication;
86
use SchulzeFelix\SearchConsole\Exceptions\InvalidConfiguration;
97

108
class SearchConsoleServiceProvider extends ServiceProvider
@@ -28,13 +26,16 @@ public function register()
2826
{
2927
$this->mergeConfigFrom(__DIR__.'/../config/search-console.php', 'search-console');
3028

31-
$searchConsoleConfig = config('search-console');
3229

33-
$this->app->bind(SearchConsoleClient::class, function () use ($searchConsoleConfig) {
30+
$this->app->bind(SearchConsoleClient::class, function () {
31+
$searchConsoleConfig = config('search-console');
32+
3433
return SearchConsoleClientFactory::createForConfig($searchConsoleConfig);
3534
});
3635

37-
$this->app->bind(SearchConsole::class, function () use ($searchConsoleConfig) {
36+
$this->app->bind(SearchConsole::class, function () {
37+
$searchConsoleConfig = config('search-console');
38+
3839
$this->guardAgainstInvalidConfiguration($searchConsoleConfig);
3940

4041
$client = app(SearchConsoleClient::class);
@@ -64,11 +65,7 @@ protected function setupConfig()
6465
{
6566
$source = realpath(__DIR__.'/../config/search-console.php');
6667

67-
if ($this->app instanceof LaravelApplication) {
68-
$this->publishes([$source => config_path('search-console.php')]);
69-
} elseif ($this->app instanceof LumenApplication) {
70-
$this->app->configure('search-console');
71-
}
68+
$this->publishes([$source => config_path('search-console.php')]);
7269

7370
$this->mergeConfigFrom($source, 'search-console');
7471
}

0 commit comments

Comments
 (0)