Configuration Issues
Edge Case 1: Config Caching Hides Environment Changes
Symptom: Environment variable changes (likeLOG_QUERY or REST_STRICT_COLUMNS) don’t take effect.
Cause: Laravel caches configuration files for performance. With cached config, .env updates are ignored until the cache is rebuilt.
1
Reproduce the Issue
- Set
LOG_QUERY=truein.env - Run
php artisan config:cache - Change
LOG_QUERY=falsein.env - Observe that queries are still being logged
2
Verify Current Config
3
Clear and Rebuild Cache
Edge Case 2: Queue Workers Use Stale Config
Symptom: Long-running queue workers behave as if old configuration is still active, even after clearing cache. Cause: Queue workers boot the application once and keep config in memory until restarted./etc/supervisor/conf.d/laravel-worker.conf
Set
--max-time=3600 to automatically restart workers every hour, ensuring they pick up config changes.Safety Limits and Timeouts
Edge Case 3: Deep Hierarchy Trees Cause Timeouts
Symptom: Hierarchy listing requests timeout when working with large, deeply nested category trees. Cause: Withoutmax_depth, the package recursively loads the entire tree, which can be thousands of records.
Edge Case 4: Excessive Filter Conditions Trigger Limits
Symptom: Requests fail withMaximum conditions (100) exceeded error.
Cause: The filter engine enforces filtering.max_conditions to prevent database overload from complex filter trees.
config/rest-generic-class.php
Concurrency Issues
Edge Case 5: Bulk Update Concurrency Collisions
Symptom: Two administrators update the same record simultaneously, and one set of changes is lost. Cause:update_multiple() applies updates row-by-row without record-level locking (last-write-wins).
Reproduce the Issue:
1
Admin 1 Updates Product
2
Admin 2 Updates Same Product (Simultaneous)
3
Result
Final state depends on which request completes last. Admin 1’s
price update might be lost.Edge Case 6: Cache Invalidation Race Conditions
Symptom: Cached data briefly shows stale information after an update. Cause: Cache version bump happens after the database write, creating a small window where stale cache is valid. Mitigation:Multi-Tenant Issues
Edge Case 7: Cross-Tenant Permission Leaks
Symptom: Users from one tenant can access permissions from another tenant. Cause: Spatie’sPermissionRegistrar uses a team ID to scope permissions. If not set, it falls back to a global cache key.
Test the Issue:
Validation Edge Cases
Edge Case 8: Invalid Relation Names
Symptom: Requests return 400 error:Relation 'internalLogs' is not allowed.
Cause: The relation exists on the model but isn’t added to the RELATIONS allowlist.
Edge Case 9: Invalid Filter Operators
Symptom: 400 error:Operator '~=' is not allowed.
Cause: The operator isn’t in the package’s allowlist.
Allowed Operators:
config/rest-generic-class.php
config/rest-generic-class.php
Production Monitoring
Edge Case 10: Rate Limiting Heavy Filters
Symptom: Complex queries cause slow responses and affect other users. Solution - Add Rate Limiting:routes/api.php
Quick Reference - Common Errors
Testing Edge Cases
Next Steps
- Review Configuration Reference for all safety limits
- Explore Complete CRUD Example for basic setup
- Check Cache Scenarios for performance optimization