The Gardeners for your website

Variable not available in blade component

Problem:

The parameter transfer of a blade attribute does not work, the variable in the component is empty. There is no error message, but the variable seems not to have been passed.

Solution:

The error may be due to the use of an "underscore" in the variable name.

Example: instead of "active_record", use "active-record" (in the blade template) or "ActiveRecord" (in the constructor of the class, if available).

Source:

https://laravel.com/docs/8.x/blade#casing

Why do people only watch documentaries when their keyboards are already smashed?

See also

More techdoks and snippets