dept-eduk / api-force-app-update
There is no license information available for the latest version (2.0.0) of this package.
2.0.0
2019-10-31 09:53 UTC
This package is not auto-updated.
Last update: 2025-04-12 10:01:10 UTC
README
This package provides migrations and middleware for locking access to the API where the app version has been blacklisted.
Pulling in with composer:
- Install the package:
composer require e3creative/api-force-app-update
Customisation
The error message given by the middleware is customisable in config/api-force-app-update.php
if you publish the
package's config file:
php artisan vendor:publish
How to Use
Add the middleware to the
$routeMiddleware
property of yourapp/Http/Kernel.php
:/** * The application's route middleware. * * These middleware may be assigned to groups or used individually. * * @var array */ protected $routeMiddleware = [ ..., 'force_app_update' => \E3Creative\ApiForceAppUpdate\Middleware\ForceUpdate::class, ];
Add the middleware to the routes you want to protect, or to the
api
middleware group inKernel.php
if you want it to be applied univerally to theapi
routes.
Route::resource('users', 'UserController')->middleware('force_app_update');
- Run the new migrations with
php artisan migrate
- Blacklist versions by adding them into your
blacklisted_versions
table