Current File : /home/tradevaly/new.tradevaly.com.bd/app/Http/Middleware/EXPIRE.php
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Brian2694\Toastr\Facades\Toastr;
class EXPIRE
{
    public function handle(Request $request, Closure $next)
    {
        if (Auth::guard('web')->check() && strtotime(Auth::guard('web')->user()->next_pay) > time()) {
            return $next($request);
        } else {
            Toastr::error('Package Is Expire Please Renew For Using Our Service Again', '', ['progressBar' => true, 'closeButton' => true, 'positionClass' => 'toast-top-right']);
            return redirect()->route('user.subs');
        }
    }
}