- How do I install and use binaryk/laravel-restify in Laravel?
- Install it with Composer using composer require binaryk/laravel-restify, then publish the package config and define your repositories. Laravel Restify builds structured REST APIs with CRUD endpoints, filtering, sorting, search, relationships, validation, authorization, and custom actions. It integrates with Laravel policies for relationship writes, so set up policy coverage for attach and sync paths.
- What Laravel and PHP versions are supported by Laravel Restify?
- The package is a Laravel/PHP Composer package, but the exact Laravel and PHP constraints depend on the release. Check composer.json and the changelog for version 10.4.62 before upgrading. Confirm those constraints match your application's runtime and framework version.
- How does Laravel Restify authorize attach and sync operations?
- It uses Laravel policies as the authorization boundary for relationship writes. The 10.4.62 release fails closed when no parent policy exists, so attach or sync requests are denied or throw instead of proceeding. Custom attachers skip the package's authorization, so you must add explicit checks for those paths.
- What changed in Laravel Restify 10.4.62 that could affect production?
- Version 10.4.62 makes authorization fail closed when no parent policy exists, applies global scopes and soft deletes during related-ID resolution, and runs writes on the model's own connection. The fail-closed change is the biggest behavioral risk because previously permissive flows may now be denied. Treat the upgrade as a patch-level but behavioral change and test in staging first.
- How should I migrate an existing Laravel app to Laravel Restify 10.4.62?
- Audit every attach and sync call site for parent-policy coverage, then add or update missing policies. Identify custom attachers and add explicit authorization because the package cannot enforce it for those paths. Run the full test suite with cases for soft-deleted related models, global-scoped related models, and non-default database connections, then deploy to staging and monitor authorization denials.
- Does Laravel Restify apply global scopes and soft deletes when resolving related IDs?
- Yes, the 10.4.62 fixes apply global scopes and soft deletes during related-ID resolution. This improves query correctness but may change which IDs are resolved compared with earlier behavior. Update tests that relied on unscoped resolution and verify query results in staging.
- Can Laravel Restify handle multi-database or multi-tenant Laravel applications?
- The 10.4.62 connection fix makes attach and sync writes use the model's own connection, which helps multi-database and multi-tenant apps. You should still verify transaction boundaries in staging for attach, sync, detach, and pivot updates. Confirm the fix covers all write paths your application uses.
- What happens if a parent model has no policy in Laravel Restify?
- The package now fails closed, so the attach or sync operation is denied or throws when no applicable parent policy exists. Existing flows that succeeded under permissive behavior will need policies added before they work again. This is a security improvement, but it can surface as production authorization errors if policy coverage is incomplete.
- How do I secure custom attachers in Laravel Restify?
- Custom attachers skip the package's built-in authorization, so the package cannot enforce policy checks for them. Inventory all custom attachers in your codebase and add explicit authorization logic inside each one. Document this caveat for your team and include authorization tests for custom attacher paths.
- What testing should I run before upgrading Laravel Restify?
- Run your full test suite plus targeted tests for soft-deleted related models, global-scoped related models, and non-default database connections. Add authorization tests for attach and sync call sites, including cases with missing parent policies. Use staging with query logging and monitor for authorization denials after deployment.