0

Inside my blade I have different components were someone are used in multiple blades so they need a different text. In my case my component has an attribute "title" were is different in the different blades that I use it. Component:

<mycomponent title="Example" />

I try to use the "@lang()" helper but it dosent works it returns me an error, I also try:

<mycomponent title={{__('general.title')}} />

But it also returns me an error in my blade. Any idea of how can I do this? Thanks for your help :)

Hello There
  • 173
  • 1
  • 10

1 Answers1

0

I solve my problem searching in the Laravel documentation. According to what it says in the section: Passing Data To Components what I have to do is:

<mycomponent :title="__('general.title')" />

The thing is that I didn't point out that I was using a blade component, sorry about that.

Hope this will be helpful for someone.

Hello There
  • 173
  • 1
  • 10