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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community