FleetCart/app/Http/Middleware/RunUpdater.php

26 lines
501 B
PHP
Raw Permalink Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace FleetCart\Http\Middleware;
use Closure;
use FleetCart\Updater;
class RunUpdater
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (config('app.installed') && file_exists(storage_path('app/update'))) {
Updater::run();
}
return $next($request);
}
}