Looking elsewhere, I see similar questions about macros and service providers being asked recently.
I have this:
<?php namespace App\Providers;
use Log, HTML, Request;
use Illuminate\Support\ServiceProvider;
use Carbon\Carbon;
class HtmlServiceProvider extends ServiceProvider {
/**
* Configure the application's logging facilities.
*
* @return void
*/
public function boot()
{
HTML::macro('active', function ($route) {
return strpos(Request::url(), route($route)) !== false ? 'class="active"' : '';
});
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}
But I get an error when I run php artisan. Even so, I am able to use the macro in my code without errors.
Any ideas?