Why I havent access to object properties?

this is my class:

public $products, $product;

public function getData($id)
{
    $this->product = Product::find($id);
}


public function render()
{
    $this->products = Product::latest()->get();
    return view('livewire.cabin');
}

and this is my livewire cabin view:

<section >
<div>afetr click on ech image: {{ $product->code }}</div>
        <div class="slideCabin">
            @foreach($products as $product)
                <div>
                    <a wire:click="getData({{ $product->id }})">
                        <img class="slideCabin-img" src="/images/allproducts/{{ $product->cover }}" >
                    </a>
                </div>

            @endforeach
        </div>
    </section>

why after clicking each image I can’t see each product property as {{ $product->code}}

Add single quotes to your method call. Change:

<a wire:click="getData({{ $product->id }})">

to

<a wire:click="getData('{{ $product->id }}')">

There’s a possibility that your variable naming collision could be causing you unexpected problems too.