<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

class VerifyCsrfToken extends BaseVerifier
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        'api/*',
        'api/v1/*',
        'api/v1/hr/*',
        'api/v1/hr/time-log',
        'api/v1/hr/time-log/*',
        'oauth/*',
    ];
    
    protected function shouldPassThrough($request)
    {
        \Illuminate\Support\Facades\Log::info('CSRF Check', [
            'url' => $request->url(),
            'path' => $request->path(),
            'should_pass' => parent::shouldPassThrough($request),
            'except_patterns' => $this->except
        ]);
        
        return parent::shouldPassThrough($request);
    }
}
