#Blade component doesn't accept variable

3 messages · Page 1 of 1 (latest)

faint stream
#

Given the following anonymous blade component tag:
<x-nav.nav-ribbon-link icon="home" bg="foo" svgicon="{!! $workspace->icon !!}" fill="none" href="{{ route('dashboard') }}" viewBox="24 24" strokeWidth=2 page="Dashboard" :active="request()->is('dashboard')" />

the component:
`@props(['active','svgicon','href','page','bg','icon'])

<div class="">
{{ $icon }}
</div>
`

The icon and bg variables result in an Undefined variable error. Note that the 'svgicon' variable actually needed to be escaped to work as well.

faint stream
#

OK, bizarre! This works, without the blade tags??:
<div class=""> $icon </div>

analog thorn
#

You have missed something here, I suspect your file is .php rather than .blade.php