Variable not available in blade component

20.09.2021

Picture of a beautifully tidy garden

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:

Possibly the error lies in 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

No contributions found