```
<?php

namespace App\Http\Middleware;

use App\Pengurus;
use Closure;
use Response;

class ApiAuth
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        header('Access-Control-Allow-Origin: *');

        $token = $request->header('APP_KEY');
        $validateToken = Pengurus::where('token',$token)->first();

        if(!$validateToken){
            return Response::json(['message'=>'Anda Belum Login, Silahkan Login Terlebih Dahulu'],401);
        }

        return $next($request);
    }
}

```

---------------------------------------------------------
---------------------------------------------------------

how to fix it?
in localhost it's works, but when i try in cpanel it's doesn't work.