<?php

namespace Support;

use Tymon\JWTAuth\JWTAuth as BaseJWTAuth;

class JWTAuth extends BaseJWTAuth {

    /**
     * Parse token from the authorization header
     *
     * @param string  $header
     * @param string  $method
     * @return false|string
     */
    protected function parseAuthHeader($header = 'authorizationJWT', $method = 'bearer')
    {
        $header = $this->request->headers->get($header);

        if (! starts_with(strtolower($header), $method)) {
            return false;
        }

        return trim(str_ireplace($method, '', $header));
    }

}
