Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Search Console Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

To begin using this package with Laravel 9, follow these updated steps for v1.8.0:

  1. PHP Version: Ensure PHP 8.0.2+ (minimum requirement).
  2. Laravel Version: Laravel 9.x only (Lumen and Laravel 8 are no longer supported).
  3. Installation: Require the package via Composer:
    composer require vendor/package-name
    
  4. Configuration: Publish the config file (if applicable) and update .env:
    php artisan vendor:publish --provider="Vendor\PackageName\PackageServiceProvider"
    
  5. First Use Case: Test basic functionality (e.g., a model trait or facade) in a controller or command:
    use Vendor\PackageName\Facades\PackageFacade;
    
    // Example usage
    $result = PackageFacade::doSomething();
    

Implementation Patterns

Core Workflows

  • Model Integration: Use the package’s traits or observers directly in Eloquent models:
    use Vendor\PackageName\Traits\ExampleTrait;
    
    class Post extends Model
    {
        use ExampleTrait;
    }
    
  • Service Layer: Leverage facades or service classes for business logic:
    $data = PackageFacade::process($input);
    
  • Middleware/Events: Hook into the package’s events or extend middleware if it provides extension points.

Laravel 9-Specific Patterns

  • Dependency Injection: Utilize Laravel 9’s improved container bindings:
    $this->app->bind('custom.package.key', function () {
        return new Vendor\PackageName\Services\CustomService();
    });
    
  • Route Model Binding: If the package supports it, use Laravel 9’s implicit route model binding:
    Route::get('/posts/{post}', [PostController::class, 'show']);
    
  • Blade Components: If the package uses Blade components, ensure compatibility with Laravel 9’s component syntax:
    <x-package::component-name />
    

Testing

  • Unit Tests: Mock the package’s facades or services:
    $this->mock(Vendor\PackageName\Facades\PackageFacade::class)
         ->shouldReceive('doSomething')
         ->andReturn($mockData);
    
  • Feature Tests: Test HTTP interactions with the package’s routes or controllers.

Gotchas and Tips

Breaking Changes (v1.8.0)

  1. Laravel 8 Drop: No longer supported. Ensure all projects are upgraded to Laravel 9.

    • Route Caching: Clear caches after upgrade:
      php artisan route:clear
      
    • Service Provider Booting: Some packages may rely on boot() methods, which are now deprecated in favor of register() + boot() separation.
    • Blade Components: Update to Laravel 9’s component syntax if the package uses Blade components.
  2. Lumen Drop: Migrate any Lumen-specific logic to Laravel 9’s framework or use a standalone PHP solution.

  3. PHP 8.0.2+: Leverage new PHP features like:

    • Named Arguments: Use in package methods if supported:
      $result = PackageFacade::method(arg1: $value, arg2: $value);
      
    • Union Types: Check for return type hints like array|string.

Debugging Tips

  • Configuration Conflicts: If the package’s config doesn’t load, verify:
    • The config file was published (vendor:publish).
    • No naming collisions with your app’s config.
  • Facade Calls: Use app() to inspect bindings if facades fail:
    dd(app()->has('custom.package.key')); // Check if bound
    
  • Deprecation Warnings: Enable Laravel’s deprecation logging:
    APP_DEBUG=true
    
    Then check storage/logs/laravel.log for warnings.

Extension Points

  • Service Providers: Extend the package’s provider by binding additional services:
    public function register()
    {
        $this->app->extend('custom.package.key', function ($service) {
            return new CustomExtension($service);
        });
    }
    
  • Events/Listeners: Subscribe to the package’s events (if documented):
    Event::listen(
        Vendor\PackageName\Events\ExampleEvent::class,
        CustomListener::class
    );
    
  • Policies/Authorizations: If the package integrates with Laravel’s auth, extend its policies:
    class PostPolicy extends Policy
    {
        public function viewAny(User $user)
        {
            return $user->isAdmin();
        }
    }
    

Performance

  • Caching: Use Laravel 9’s improved cache tags or cache events if the package supports it:
    Cache::tags(['package-data'])->put('key', $value, $seconds);
    
  • Queue Jobs: Offload heavy tasks to queues if the package provides job classes.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky