• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 195

Backtrace:

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/views/question.php
Line: 195
Function: _error_handler

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/controllers/Questions.php
Line: 416
Function: view

File: /home/u125378470/domains/lawhelpguru.org/public_html/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Getting value to show up using livewire

<button aria-describedby="--stacks-s-tooltip-rztwy5s6" aria-label="Bookmark" aria-pressed="false" class="js-bookmark-btn s-btn s-btn__unset c-pointer py4 js-gps-track" data-controller="s-tooltip" data-gps-track="post.click({ item: 1, priv: 0, post_type: 1 })" data-s-tooltip-placement="right" data-selected-classes="fc-yellow-600"></button><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" height="18" viewbox="0 0 19 18" width="19"></svg>

 

I'm using laravel and livewire and I'm trying to create an edit page. What I'm trying to do is get the value to show up in the textbox. So for example my edit page has product info that I'm trying to edit, but my product name isn't displaying in the textbox.

Here is my code

My ProductEdit.php

<?php

namespace ModulesProductsHttpLivewire;

use AppModelsProduct;
use LivewireComponent;

class ProductsEdit extends Component
{
    public $name;
    public $product;

    public function render()
    {
        return view('products::livewire.edit-products', [
            'name' => $this->product->name
        ]);
    }

    public function updateProduct()
    {
        dd($this->name);
    }
}

My edit-products.blade.php

class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2"> <input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="product_name" type="text" name="product_name" value="{{ $product->name }}" wire:model="name" >