Answer the question
In order to leave comments, you need to log in
Why don't macros work in laravel 5?
Created a macro in AppServiceProvider
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider {
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
\Html::macro('test', function() {
return 'default';
});
}
{{ Html::test() }}
Method test does not exist. (View: C:\xampp\htdocs\lar.ru\resources\views\sub\test\shop.blade.php)
Answer the question
In order to leave comments, you need to log in
Check if you registered your provider exactly in config/app.php, check the sequence of registering providers, if you have \Html, it was cut out in laravel 5 .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question