Can I use @component inside my blade templates in Sage 9?

I’m doing my first big project with sage 9. I’m trying to use the @component directive inside my templates. For that, I created the views/components folder and I’m trying to call the component inside the template by using @component('') but is not working.

Am I missing something here? Is there anything I should setup before using it?

1 Like

@component works as expected.


<div class="notification {{ $type or 'is-primary' }}">
  <button class="delete"></button>
  {{ $slot }}

Use in a view:

  This is a notification!

What about aliasing as described here:
Where does the config for that go in Sage?

1 Like

As far as I can tell, there is currently no easy way (i.e. following the posted documentation) to alias Blade components in Sage right now. Sage only just recently bumped Laravel to 5.6. There is some related conversation here: