## Getting Started
1. **Check Compatibility**: Verify your project uses **PHP 8.2+** and **Symfony 7.4+** (or higher) due to the dropped support for PHP 8.1/Symfony 7.3. Run:
```bash
php -v && composer show symfony/http-foundation
composer require vendor/package-name:^3.0
use Vendor\Package\Facades\PackageFacade;
Route::get('/test', function () {
return PackageFacade::exampleMethod();
});
public function __construct(private PackageService $service) {}
config/package.php if the package introduces new settings (e.g., middleware, defaults).app/Http/Kernel.php:
protected $middleware = [
\Vendor\Package\Http\Middleware\ExampleMiddleware::class,
];
EventServiceProvider:
protected $listen = [
\Vendor\Package\Events\ExampleEvent::class => [
\App\Listeners\HandleExampleEvent::class,
],
];
Class 'Symfony\Component\HttpFoundation\...' not found or PHP Fatal Error: Unsupported opcode.composer require symfony/http-foundation:^7.4
Attribute routes), migrate legacy routes:
// Old (Symfony 7.x)
Route::get('/old', 'Controller@method');
// New (Symfony 8.x)
#[Route('/new', name: 'new')]
public function method() {}
array_unpack improvements) or Symfony 8’s test utilities.use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
public function testExample(): void {
$client = static::createClient();
$client->request('GET', '/test');
$this->assertResponseIsSuccessful();
}
php.ini:
opcache.jit_buffer_size=100M
opcache.jit=tracing
PackageContract) to extend functionality without overriding core logic.use Vendor\Package\Contracts\ExampleContract;
class CustomService implements ExampleContract {
public function customMethod() { ... }
}
How can I help you explore Laravel packages today?