Variables that are defined in Livewire component not access in the blade html code (Custom HTML Tags )

338 views Asked by At
    <div x-data="{ open: @entangle('showEditt') }" id="welcoEmeDiv">
        <x-modal-lg confirmText="{{ __('Update') }}" action="update">
            <p class="text-xl font-semibold">{{ __('Update Product') }}</p>
            <x-input title="{{ __('Name') }}" name="name" />
            <div class="grid grid-cols-2 space-x-4">
                <div>
                    <x-select title="{{ __('Barcode Type') }}" name="barcode_type" :options="['code_128', 'code_39', 'ean8', 'ean13', 'upc']" selected="{{ !empty($selectedModell) ? $selectedModell->barcode_type : 'code_128' }}" />
                    <x-input-error message="{{ $errors->first('barcode_type') }}" />
                </div>
                <x-input title="{{ __('Barcode') }}" name="barcode" />

This is html code i cannot access the attribute $selectedModell->barcode_type inside the html code

public $selectedModell;
public function openModal($id)
{

$this->selectedModell = Product::find($id);
$this->showEditt=true;

}

This function open the view and get the object selectedModell. I can't access to the object selectedModell in the blade why ?!!

0

There are 0 answers