swooletw / hyperf-packages
The packages for Laravel Hyperf maintained by SwooleTW.
Requires
- php: >=8.2
- composer-runtime-api: ^2.2
- ext-hash: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
- ext-pdo: *
- friendsofhyperf/command-signals: ~3.1.0
- hyperf/cache: ~3.1.0
- hyperf/command: ~3.1.0
- hyperf/config: ~3.1.0
- hyperf/crontab: ~3.1.0
- hyperf/database-sqlite: ~3.1.0
- hyperf/db-connection: ~3.1.0
- hyperf/engine: ^2.10
- hyperf/framework: ~3.1.0
- hyperf/guzzle: ~3.1.0
- hyperf/http-server: ~3.1.0
- hyperf/memory: ~3.1.0
- hyperf/process: ~3.1.0
- hyperf/signal: ~3.1.0
- hyperf/translation: ~3.1.0
- hyperf/validation: ~3.1.0
- laravel/serializable-closure: ^1.3
- lcobucci/jwt: ^5.0
- league/commonmark: ^2.2
- monolog/monolog: ^3.1
- nesbot/carbon: ^2.16
- nunomaduro/termwind: ^2.0
- psr/log: ^1.0|^2.0|^3.0
- ramsey/uuid: ^4.7
- symfony/error-handler: ^6.3
- symfony/mailer: ^6.2
- tijsverkoyen/css-to-inline-styles: ^2.2.5
Requires (Dev)
- fakerphp/faker: ^2.0
- filp/whoops: ^2.15
- friendsofphp/php-cs-fixer: ^3.57.2
- hyperf/devtool: ~3.1.0
- hyperf/redis: ~3.1.0
- hyperf/testing: ~3.1.0
- hyperf/view-engine: ~3.1.0
- league/flysystem: ^3.0
- league/flysystem-aws-s3-v3: ^3.0
- league/flysystem-google-cloud-storage: ^3.0
- league/flysystem-path-prefixing: ^3.3
- league/flysystem-read-only: ^3.3
- mockery/mockery: ^1.5.1
- pda/pheanstalk: v5.x-dev
- phpstan/phpstan: ^1.11.5
- phpunit/phpunit: ^10.0.7
- swoole/ide-helper: ~5.1.0
Suggests
- aws/aws-sdk-php: Required to use the SES mail driver (^3.235.5).
- friendsofhyperf/tinker: Required to use the tinker console command (^3.1).
- hyperf/redis: Required to use redis driver. (^3.1).
- hyperf/session: Required to use session guard. (^3.1).
- league/flysystem-read-only: Required to use read-only disks (^3.3)
- symfony/http-client: Required to use the Symfony API mail transports (^6.2).
- symfony/mailgun-mailer: Required to enable support for the Mailgun mail transport (^6.2).
- symfony/postmark-mailer: Required to enable support for the Postmark mail transport (^6.2).
Replaces
- swooletw/hyperf-auth: dev-master
- swooletw/hyperf-bus: dev-master
- swooletw/hyperf-cache: dev-master
- swooletw/hyperf-config: dev-master
- swooletw/hyperf-container: dev-master
- swooletw/hyperf-cookie: dev-master
- swooletw/hyperf-devtool: dev-master
- swooletw/hyperf-dispatcher: dev-master
- swooletw/hyperf-encryption: dev-master
- swooletw/hyperf-event: dev-master
- swooletw/hyperf-filesystem: dev-master
- swooletw/hyperf-foundation: dev-master
- swooletw/hyperf-framework: dev-master
- swooletw/hyperf-hashing: dev-master
- swooletw/hyperf-http: dev-master
- swooletw/hyperf-jwt: dev-master
- swooletw/hyperf-log: dev-master
- swooletw/hyperf-mail: dev-master
- swooletw/hyperf-notifications: dev-master
- swooletw/hyperf-object-pool: dev-master
- swooletw/hyperf-prompts: dev-master
- swooletw/hyperf-queue: dev-master
- swooletw/hyperf-router: dev-master
- swooletw/hyperf-support: dev-master
This package is auto-updated.
Last update: 2024-12-20 09:54:31 UTC
README
Introduction
Laravel Hyperf is a Laravel-style skeleton based on Hyperf framework designed for Laravel artisans.
Besides the high performance brought by Swoole. It adopts Laravel's directory structure and component styles while migrating many common Laravel packages such as Auth
, Cache
, Config
, Container
, Command
, Database
, Event
, Facade
, Router
, Middleware
, Log
, Encryption
, Hashing
, Error Handling
, Validation
, Service Provider
, Blade
, Eloquent
, String
, Array
, Collection
, Translation
, Testing
, etc to be more coroutine-friendly. If you're a Laravel developer, you'll feel right at home with this framework, requiring minimal additional learning.
Why Laravel Hyperf?
While Laravel Octane is impressive and significantly improves your Laravel application's speed and performance, it's important to consider the nature of modern web applications. In most cases, the majority of latency comes from I/O operations, such as reading files, querying databases and making API requests.
If your application relies heavily on slow I/O operations, you may still encounter performance bottlenecks. Consider this scenario:
Imagine building an AI-powered chatbot where each conversation API takes 3-5 seconds to respond. If you have 10 workers in Laravel Octane and receive 10 concurrent requests, all workers would be occupied until these requests complete.
You can see benchmark comparison between Laravel Octane and Laravel Hyperf
In such cases, even with Laravel Octane's improvements, your application's ability to handle concurrent requests is still limited by the duration of these I/O operations. Laravel Hyperf addresses this issue by leveraging coroutines, allowing for efficient handling of concurrent I/O operations without blocking workers. This approach can significantly improve the performance and concurrency of applications with heavy I/O requirements.
For I/O-intensive scenarios, Laravel Octane may not significantly boost performance. Moreover, and it's unlikely that Laravel Octane will support coroutines in the near future (see this issue), given that only Swoole runtime currently supports this feature and considering backward compatibility with the framework and third-party packages.
Even if Laravel Octane supported coroutines, these coroutines would still be limited to a single request, with workers remaining blocked until all I/O operations within that request completed. That means your Laravel application can't get better QPS results in this kind of scenario.
See this pull request for more information.
Laravel Hyperf aims to help Laravel artisans enjoy the high performance of Hyperf while maintaining familiar Laravel development practices. It's compatible with Hyperf packages, ensuring developers can share the same ecosystem and community. We encourage developers to contribute to the Hyperf project, benefiting both Hyperf and Laravel Hyperf simultaneously.
Documentation
https://laravel-hyperf.com/docs
Laravel Hyperf provides comprehensive and user-friendly documentation that allows you to quickly get started. From this documentation, you can learn how to use various components in Laravel Hyperf and understand the differences between this framework and Laravel.
Most of the content in this documentation is referenced from the official Laravel documentation. We appreciate the Laravel community's contributions.
License
The Laravel Hyperf framework is open-sourced software licensed under the MIT license.