<?php

namespace App\Http\Middleware;

use Closure;

use Illuminate\Support\Facades\Auth;

class Admin
{
    public function handle($request, Closure $next)
    {
      if(Auth::user()->account_type < 12){
          return response()->json([ 'error' => true, 'data' => 'El usuario no es administrador' ], 401);
      }
      return $next($request);
    }
}
