Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • 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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(