1
I have a problem with Laravel that I can’t solve, and I’ve tried many things: What I want is to take the values that are on one page and send to another on a form.
The edit button in a list has the following code:
<a class="dropdown-item" href="{{ route('people.edit', $people) }}">{{ __('Editar') }}</a>
That is the route:
Route::put('peoples', ['as' => 'peoples.edit', 'uses' => 'PeopleController@edit']);
That’s the code on the controller
public function edit(People $people)
{
return view('profilePeople.edit', compact('people'));
}
This is the class code
<?php namespace App; use Illuminate\Database\Eloquent\Model; class People extends Model { protected $table = 'people'; protected $fillable = ['name', 'email',]; protected $guarded = ['id']; }
This is the code where an input should retrieve past values.
<input type="text" name="name" id="input-name" class="form-control form-control-alternative{{ $errors->has('name') ? ' is-invalid' : '' }}" placeholder="{{ __('Nome') }}" value="{{ old('name', $people->name) }}" required autofocus>
There is no error but the values are not passed.
I do not know if with this information someone can help me, but just send me the information you need and I will add.
From now on, thank you!
It worked super well! I broke my head so much and you solved it so fast. Thank you so much!
– Calebe Pereira