1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00
invoiceninja/app/Http/Middleware/EligibleForMigration.php

25 lines
461 B
PHP
Raw Normal View History

<?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');
}
}