- How do I install afiqiqmal/approval-laravel in Laravel?
- Install it with Composer using composer require afiqiqmal/approval-laravel. Then publish the package config and migrations, run php artisan migrate, and add the provided trait to any Eloquent model that needs an approval workflow. Confirm the exact publish tags and trait name in the package README or source for the 2.0 release.
- Which Laravel and PHP versions does approval-laravel 2.0 support?
- The technical evaluation assumes 2.0.0 targets a modern Laravel stack, likely Laravel 9, 10, or 11 with PHP 8.1 or newer, but the release note only says update dependencies. Check composer.json for the exact laravel/framework and php constraints before upgrading. If your app is on Laravel 8 or PHP 7.4, the package may force a framework upgrade.
- How do I attach approvers to an Eloquent model with approval-laravel?
- The package is designed around Eloquent traits, so you typically add its approval trait to the model and define the approvers or approval flow in configuration or model methods. The overview says you can attach approvers, track status, and gate actions until sign-off. Confirm the exact API names in the 2.0 README because the major version may have changed method signatures.
- Can approval-laravel gate actions until approval is complete?
- Yes, the package overview describes gating actions until sign-off is complete, which is useful for review or approval steps before changes take effect. You would usually check approval status in your controllers, policies, or model methods before allowing the action. Test the gate behavior in your own app because the exact helper or scope names may differ in 2.0.
- Is afiqiqmal/approval-laravel suitable for content moderation or expense approvals?
- It is a generic approval workflow engine for Laravel, so it fits common cases such as content moderation, expense requests, leave management, and other review steps. It works best in a standard Laravel monolith or modular monolith where approval logic belongs in the application layer. For high-value financial approvals, review the package test coverage and maintenance activity before making it central to business logic.
- What breaking changes are in approval-laravel 2.0 compared with 1.6?
- The 2.0.0 release note only says update dependencies, so the exact breaking changes are not documented in the provided context. A major version bump means you should assume possible changes to public APIs, database schema, events, or supported Laravel and PHP versions. Review the GitHub compare link from 1.6.0 to 2.0.0 and check closed issues and pull requests before upgrading.
- How do I upgrade afiqiqmal/approval-laravel from 1.x to 2.0?
- Start in a spike or staging branch, change composer.json to ^2.0, and run composer update to capture dependency conflicts. Run migrations and diff the schema for new, renamed, or retyped columns, then run your approval flow tests. If you find breaking changes, use an adapter layer or phased migration and ask the maintainer for an upgrade guide if one is not published.
- Does approval-laravel fire events or send notifications to approvers?
- The evaluation suggests the package may integrate events and notifications, but the provided context does not confirm the exact event names or notification classes. Check the package source and README for events, listeners, and notification hooks in 2.0. If notifications are not built in, you can dispatch your own Laravel notifications from approval status changes.
- How should I test approval workflows with approval-laravel?
- Run the package own test suite in your environment, then add feature tests that create a model, attach approvers, request approval, and assert that gated actions are blocked until sign-off. Use database migrations and factories in a test database to verify schema behavior. Focus especially on upgrade tests from 1.x to 2.0 if you are migrating.
- Is afiqiqmal/approval-laravel actively maintained and safe for production?
- The provided evaluation flags high technical risk because 2.0.0 has a vague release note and a major version bump without a detailed changelog. Check the GitHub release cadence, issue response time, and test coverage before using it for critical approval gates. For production, pin the version, run a staging migration, and keep an adapter boundary so you can replace the package or switch to a custom approval flow if needed.