mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
9d5c3bd951
* Add check for 0 value * David said, this one is better
25 lines
461 B
PHP
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');
|
|
}
|
|
}
|