mercredi 1 novembre 2017

Call an env constant in a middleware file on Laravel

I'm trying to call an .env constant from a Middleware file using Laravel, but I'm only getting Constant expression contains invalid operation.

This is my actual code:

<?php

namespace App\Http\Middleware;

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

class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        env("TELEGRAM_BOT_TOKEN") . '/webhook'
    ];
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ylLVXz
via IFTTT

Aucun commentaire:

Enregistrer un commentaire