Laravel +11 how to set validateCsrfToken dinamically

RMAG news
<?php

namespace AppProviders;

use IlluminateContractsFoundationApplication;
use IlluminateFoundationHttpMiddlewareValidateCsrfToken;
use IlluminateSupportServiceProvider;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/

public function register(): void
{
//
}

/**
* Bootstrap any application services.
*/

public function boot(): void
{
// here we can use any value from env() or config()
ValidateCsrfToken::except(‘*’);
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *