Call to undefined function App\Core\Bootstrap\addHtmlAttribute()
I implemented Metronic laravel version on Laravel 10 fresh installation and have been battling with the following error:
Call to undefined function App\Core\Bootstrap\addHtmlAttribute(),
Meanwhile, the function is defined as follows in the AppServiceProvider
public function boot()
{
Schema::defaultStringLength(191);
// Init layout file
app(\App\Core\Bootstrap\BootstrapDefault::class)->init();
$this->setDbConfigurations();
app()->useLangPath(base_path('lang'));
}
PLease help
Replies (1)
Hi,
Based on the error message you're seeing, it seems like your application does not recognise the function addHtmlAttribute(). Here are a few things you can try to troubleshoot the issue:
Check if the namespace is correct: Ensure that the namespace of the file where the function is defined matches the namespace in which it is being called. If the namespaces do not match, the function may not be accessible.
Clear the cache: Sometimes, Laravel's internal cache may cause issues recognizing new or updated code. Try clearing your application's cache by running php artisan cache:clear
in your terminal.
Hopefully, one of these solutions will help resolve the issue you're seeing. If not, please provide more information about your application setup and where the addHtmlAttribute() function is being called, and I can try to provide further assistance.
Thanks