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

Orion Laravel Package

cortezvini97/orion

Orion is a Laravel package that speeds up building REST APIs by providing ready-to-use controllers, filtering, sorting, searching, pagination, relations and authorization hooks, so you can expose Eloquent models quickly with less boilerplate.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Orion
How does Orion reduce boilerplate for REST API endpoints in Laravel?
Orion provides pre-built controller structures, CRUD operations, and common API features like filtering, sorting, and pagination. Instead of writing repetitive code for each Eloquent model, you define rules once and let Orion generate the endpoints automatically, cutting development time significantly.
Which Laravel versions does Orion support?
Orion is designed for Laravel 8.x and 9.x, leveraging modern PHP features like named arguments and attributes. Check the package’s `composer.json` for exact version constraints, but it avoids breaking changes with Laravel’s core API patterns.
Can Orion handle complex API filtering (e.g., nested relations or custom logic)?
Yes, Orion supports dynamic filtering via query builder methods or Eloquent scopes. For nested relations, you can define them in the model’s `$with` property or use Orion’s relation handling to include them in responses automatically. Custom logic can be injected via closures or middleware.
Does Orion work with Laravel’s built-in API resources or does it require its own?
Orion integrates seamlessly with Laravel’s API resources. You can use existing resources or define new ones, and Orion will handle serialization, pagination, and metadata (like links for pagination) automatically. This keeps your API responses consistent with Laravel’s conventions.
How does Orion handle API authorization (e.g., Gates, Policies, or middleware)?
Orion supports Laravel’s native authorization mechanisms, including Gates, Policies, and middleware. You can attach authorization logic to specific actions (e.g., `index`, `store`) via the package’s configuration or by extending Orion’s base controller. It won’t override your existing auth setup.
Is Orion compatible with Laravel’s Sanctum or Passport for API authentication?
Absolutely. Orion treats authentication as a first-class citizen and works out of the box with Sanctum, Passport, or any other Laravel auth package. You just need to ensure your routes are protected with the usual middleware (e.g., `auth:sanctum`), and Orion will respect those rules.
Can I customize Orion’s pagination (e.g., custom page sizes, cursor-based pagination)?
Yes, Orion allows full customization of pagination. You can override default settings like items per page, use cursor-based pagination with `CursorPaginator`, or even disable pagination entirely for specific endpoints. Configuration is done via the package’s service provider or model bindings.
Does Orion support API versioning, and how does it handle route conflicts?
Orion integrates with Laravel’s route model binding and API versioning (e.g., via `Route::prefix('v1')`). To avoid conflicts, it uses namespaced controllers and allows you to define version-specific configurations. You can also manually prefix routes or use Laravel’s built-in versioning tools.
How do I test Orion’s API endpoints in PHPUnit or Pest?
Testing Orion endpoints is straightforward with Laravel’s testing tools. Use `Http::fake()` to mock API responses, test authorization with `actingAs()`, and validate JSON responses with `assertJson()`. Orion’s controllers follow Laravel conventions, so existing test patterns (e.g., `create()`, `assertDatabaseHas()`) work seamlessly.
Are there performance considerations when using Orion in production?
Orion is optimized for performance, but heavy use of dynamic filtering or deep relations may impact query complexity. Always profile your API with tools like Laravel Debugbar or Blackfire. For large datasets, consider caching responses or using database indexes for filtered queries. Orion’s pagination and eager loading help mitigate overhead.
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.
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
spatie/mailcoach-vapor