1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/app/Http/Middleware/EligibleForMigration.php
Benjamin Beganović 9d5c3bd951
[v1] Add check for 0 value (#3473)
* Add check for 0 value

* David said, this one is better
2020-03-11 10:06:57 +11:00

25 lines
461 B
PHP

<?php
namespace App\Http\Middleware;
use Closure;
class EligibleForMigration
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (auth()->user()->eligibleForMigration()) {
return $next($request);
}
return redirect('/settings/account_management');
}
}