Support the ongoing development of Laravel.io →
posted 8 years ago
Packages
Last updated 2 years ago.
0

create new file BladeServiceProvider in app/providers

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Blade;

class BladeServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Blade::extend(function($value) {
            return preg_replace('/\@define(.+)/', '<?php ${1}; ?>', $value);
        });
    }

    public function register()
    {
        //
    }
}

and add

'App\Providers\BladeServiceProvider',

to config/app.php

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

rdxrbn rdxrbn Joined 28 May 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.