Sindbad~EG File Manager

Current Path : /home/copmadinaarea/creditunion.copeastlegondistrict.org/app/Http/Middleware/
Upload File :
Current File : /home/copmadinaarea/creditunion.copeastlegondistrict.org/app/Http/Middleware/Admin.php

<?php

namespace App\Http\Middleware;

use Illuminate\Http\Response;
use Closure;
use Auth;

class Admin
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
		
		if(Auth::User()->user_type != 'admin'){
			if( ! $request->ajax()){
			   return back()->with('error',_lang('Permission denied !'));
			}else{
				return new Response('<h5 class="text-center text-danger">'._lang('Permission denied !').'</h5>');
			}		
		}
		
        return $next($request);
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists