Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

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


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

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


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(