Reputation: 11
I Have a blade directive, register in AppServiceProvider, @rupiah
I want to use my directive in my laravel component.
<x-form.input name="NLTRX" label="Nilai Transaksi" disabled="true" value="{{ rupiah($retailPending['NLTRX']) }}" />
But its return error, Call to undefined function rupiah().
Any solutions?
I try using
value="{{ rupiah($retailPending['NLTRX']) }}"
:value=" rupiah($retailPending['NLTRX']) "
:value="@rupiah($retailPending['NLTRX']) "
It did'nt work either
Upvotes: 1
Views: 33
Reputation: 1
Instead of calling rupiah()
in the attribute, you can use the directive inside the component.
Modify your Blade component template (form/input.blade.php):
<input type="text" name="{{ $name }}" value="@rupiah($value)" {{ $attributes }} />
Then, use the component like this:
<x-form.input name="NLTRX" label="Nilai Transaksi" disabled="true" :value="$retailPending['NLTRX']" />
Upvotes: 0