Sindbad~EG File Manager

Current Path : /home/zada/www/app/Http/Middleware/
Upload File :
Current File : /home/zada/www/app/Http/Middleware/isPreorder.php

<?php

namespace App\Http\Middleware;

use Auth;
use Closure;

class isPreorder
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (addon_is_activated('preorder')) {

            // if auth user is seller but preorder product for seller is not activated
            if(Auth::check() && Auth::user()->user_type == 'seller' && (get_setting('seller_preorder_product') == 0)){
                abort(404);
            }

            return $next($request);
        }
        else{
            abort(404);
        }
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists (>^ω^<)看过哭02teddd(>^ω^<)看过哭02teddd