Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds support for activating and deactivating API applications, enhances authentication logic to distinguish between API key and Basic Auth, and introduces relevant database and API changes. It also improves type casting and adds new admin endpoints for managing application status.
Authentication and middleware improvements:
ApiAuthMiddlewareto support both API key and Basic Auth authentication, with clear error messages for missing or invalid credentials, and checks for application active status before allowing access. (app/Http/Middleware/ApiAuthMiddleware.php[1] [2]Database and model updates:
is_activeboolean column to theapplicationstable via a migration, defaulting totrue. (database/migrations/2025_09_12_162459_add_is_active_to_aplications_table.phpdatabase/migrations/2025_09_12_162459_add_is_active_to_aplications_table.phpR1-R32)Applicationmodel to includeis_activein fillable fields, cast it as a boolean, and added anactivequery scope. Also enabled timestamps and fixed key generation to useStr::random. (app/Models/Application.php[1] [2] [3]API and routing changes:
routes/api.phproutes/api.phpR67-R71)Dependency management:
cipher-baseandsha.jsinpackage.jsonto ensure secure and up-to-date cryptography dependencies. (package.jsonpackage.jsonR21-R24)