product = $this->category->products()->where('slug', $product)->where('hidden', false)->firstOrFail(); } public function render() { return view('products.show')->layoutData([ 'title' => $this->product->name, 'image' => $this->product->image ? Storage::disk('public')->url($this->product->image) : null, ]); } }