VOOZH about

URL: https://deepwiki.com/invokable/laravel-boost-phpstorm-copilot/8.3-phpstormcopilotserviceprovider-api

⇱ PhpStormCopilotServiceProvider API | invokable/laravel-boost-phpstorm-copilot | DeepWiki


Loading...
Last indexed: 28 February 2026 (57ef88)
Menu

PhpStormCopilotServiceProvider API

Purpose and Scope

This page documents the PhpStormCopilotServiceProvider class, which serves as the Laravel service provider responsible for registering the PhpStormCopilot agent with the Laravel Boost framework. This provider is automatically discovered by Laravel and executes during the application bootstrap process to make the phpstorm-copilot agent available to the Boost system.

For documentation on the agent class itself, see PhpStormCopilot Class API. For information on the WSL support trait, see WithWSL Trait API. For the overall Laravel Boost integration architecture, see Laravel Boost Integration.

Sources: src/PhpStormCopilotServiceProvider.php1-21


Class Overview

The PhpStormCopilotServiceProvider class is a minimal Laravel service provider that extends Illuminate\Support\ServiceProvider. Its sole responsibility is to register the PhpStormCopilot agent class with the Laravel Boost framework during the application boot process.

PropertyValue
NamespaceRevolution\Laravel\Boost
ExtendsIlluminate\Support\ServiceProvider
File Locationsrc/PhpStormCopilotServiceProvider.php1-21
Methodsregister(), boot()
Auto-DiscoveredYes (via composer.json extra.laravel.providers)

Sources: src/PhpStormCopilotServiceProvider.php5-21


Service Provider Architecture


Diagram: Service Provider Registration Flow

This diagram shows how Laravel's auto-discovery mechanism loads the service provider, how the service container manages its lifecycle through the register() and boot() methods, and how the boot() method registers the agent with the Boost framework.

Sources: src/PhpStormCopilotServiceProvider.php10-21 tests/Feature/PhpStormCopilotServiceProviderTest.php8-13


Public Methods

register()


The register() method is called during the service provider registration phase, before all providers have been registered. This implementation is intentionally empty as no service container bindings or service registrations are required for this package.

Parameters: None

Return Value: void

Implementation: src/PhpStormCopilotServiceProvider.php12-15

Purpose: This method is part of the standard Laravel service provider interface. It remains empty because the package does not need to bind any services or register any dependencies during the registration phase.

Sources: src/PhpStormCopilotServiceProvider.php12-15


boot()


The boot() method is called after all service providers have been registered. This method performs the core responsibility of the service provider: registering the PhpStormCopilot agent with the Laravel Boost framework.

Parameters: None

Return Value: void

Implementation: src/PhpStormCopilotServiceProvider.php17-20

Behavior:

  1. Calls Boost::registerAgent() facade method
  2. Passes the agent key 'phpstorm-copilot' as the first parameter
  3. Passes the agent class name PhpStormCopilot::class as the second parameter
  4. The Boost framework stores this mapping in its agent registry

Sources: src/PhpStormCopilotServiceProvider.php17-20


Agent Registration Mechanism


Diagram: Agent Registration Sequence

This sequence diagram illustrates the complete lifecycle of agent registration, from Laravel application bootstrap through to the agent being available for use by the Boost framework.

Sources: src/PhpStormCopilotServiceProvider.php17-20 tests/Feature/PhpStormCopilotServiceProviderTest.php8-13


Boost::registerAgent() Integration

The boot() method delegates all registration logic to the Boost::registerAgent() method at src/PhpStormCopilotServiceProvider.php19 This method accepts two parameters:

ParameterTypeValuePurpose
$keystring'phpstorm-copilot'Unique identifier for the agent in the registry
$classstringPhpStormCopilot::classFully qualified class name of the agent

Agent Key: The key 'phpstorm-copilot' identifies this agent throughout the Boost framework. It appears in:

  • The agent registry retrieved via Boost::getAgents()
  • boost.json configuration files
  • The php artisan boost:install agent selection prompt

Agent Class: PhpStormCopilot::class resolves to Revolution\Laravel\Boost\PhpStormCopilot. The Boost framework instantiates this class when the agent is selected for use.

Sources: src/PhpStormCopilotServiceProvider.php19 composer.json47-53


Auto-Discovery Configuration

The service provider is automatically discovered by Laravel through the extra.laravel.providers entry in composer.json47-53 The fully qualified class name Revolution\\Laravel\\Boost\\PhpStormCopilotServiceProvider is listed there, which causes Laravel's package discovery mechanism to register the provider without any manual addition to config/app.php.

Discovery Process:

  1. Composer installs the package and reads composer.json
  2. Laravel's package discovery reads the extra.laravel.providers configuration at composer.json49-51
  3. Laravel adds PhpStormCopilotServiceProvider to the list of service providers
  4. The service provider's register() and boot() methods are called during application bootstrap

Sources: composer.json47-53 src/PhpStormCopilotServiceProvider.php1-21


Service Provider Lifecycle


Diagram: Service Provider Lifecycle State Machine

This state diagram shows the complete lifecycle of the service provider from package installation through to runtime availability of the registered agent.

Sources: src/PhpStormCopilotServiceProvider.php12-20


Verification and Testing

The package includes a feature test to verify that the service provider correctly registers the agent with the Laravel Boost framework.

Test Implementation

The feature test in tests/Feature/PhpStormCopilotServiceProviderTest.php8-13 calls Boost::getAgents() and asserts that the registry contains the key 'phpstorm-copilot' mapped to PhpStormCopilot::class. This verifies both that the service provider ran its boot() method and that the Boost framework stored the registration correctly.

Sources: tests/Feature/PhpStormCopilotServiceProviderTest.php1-13


Integration Points

The service provider integrates with the following components:

ComponentIntegration MethodPurpose
Laravel Service ContainerAuto-discovery + Service Provider lifecycleAutomatic registration during application bootstrap
Laravel Boost FrameworkBoost::registerAgent() facade callRegisters agent in Boost agent registry
PhpStormCopilot AgentClass name passed to registerAgent()Makes agent available for instantiation and use
Composer Package Systemcomposer.json extra configurationEnables automatic provider discovery

Sources: src/PhpStormCopilotServiceProvider.php1-21 tests/Feature/PhpStormCopilotServiceProviderTest.php8-13


Class Dependencies


Diagram: Class Dependencies and Relationships

This diagram maps the concrete class dependencies between the service provider, Laravel's base service provider class, the Laravel Boost framework, and the PhpStormCopilot agent class.

Sources: src/PhpStormCopilotServiceProvider.php5-21


Summary

The PhpStormCopilotServiceProvider is a minimal service provider with a single responsibility: registering the PhpStormCopilot agent with the Laravel Boost framework. Key characteristics:

  • Minimal Implementation: Only the boot() method contains logic; register() is intentionally empty
  • Single Registration Call: The entire provider executes one statement: Boost::registerAgent('phpstorm-copilot', PhpStormCopilot::class)
  • Auto-Discovered: Laravel automatically discovers and registers this provider via composer.json configuration
  • Testable: Registration can be verified by retrieving the agent registry via Boost::getAgents()
  • Integration Point: Serves as the bridge between the package and the Laravel Boost framework

Sources: src/PhpStormCopilotServiceProvider.php1-21 tests/Feature/PhpStormCopilotServiceProviderTest.php1-13