schulzefelix/laravel-search-console
Laravel package to query the Google Search Console API. Set an access token, list verified sites, fetch site details and metrics, and integrate easily via a facade. Supports OAuth (env or JSON) and service accounts with publishable config.
To begin using this package with Laravel 9, follow these updated steps for v1.8.0:
composer require vendor/package-name
.env:
php artisan vendor:publish --provider="Vendor\PackageName\PackageServiceProvider"
use Vendor\PackageName\Facades\PackageFacade;
// Example usage
$result = PackageFacade::doSomething();
use Vendor\PackageName\Traits\ExampleTrait;
class Post extends Model
{
use ExampleTrait;
}
$data = PackageFacade::process($input);
$this->app->bind('custom.package.key', function () {
return new Vendor\PackageName\Services\CustomService();
});
Route::get('/posts/{post}', [PostController::class, 'show']);
<x-package::component-name />
$this->mock(Vendor\PackageName\Facades\PackageFacade::class)
->shouldReceive('doSomething')
->andReturn($mockData);
Laravel 8 Drop: No longer supported. Ensure all projects are upgraded to Laravel 9.
php artisan route:clear
boot() methods, which are now deprecated in favor of register() + boot() separation.Lumen Drop: Migrate any Lumen-specific logic to Laravel 9’s framework or use a standalone PHP solution.
PHP 8.0.2+: Leverage new PHP features like:
$result = PackageFacade::method(arg1: $value, arg2: $value);
array|string.vendor:publish).app() to inspect bindings if facades fail:
dd(app()->has('custom.package.key')); // Check if bound
APP_DEBUG=true
Then check storage/logs/laravel.log for warnings.public function register()
{
$this->app->extend('custom.package.key', function ($service) {
return new CustomExtension($service);
});
}
Event::listen(
Vendor\PackageName\Events\ExampleEvent::class,
CustomListener::class
);
class PostPolicy extends Policy
{
public function viewAny(User $user)
{
return $user->isAdmin();
}
}
Cache::tags(['package-data'])->put('key', $value, $seconds);
How can I help you explore Laravel packages today?