gpt4 book ai didi

javascript - 我的文本区域值不会进入数据库

转载 作者:行者123 更新时间:2023-11-28 06:20:33 26 4
gpt4 key购买 nike

我试图从我的 add.blade 中的表单中获取我的专家的简介,但检索到的唯一数据是姓名...我尝试清空文本区域内的值并给出 value="{{ old('bio ')"}} 仍然不起作用。这是最新的代码..

add.blade.php

<form method="post" action="{{ route('creato') }}">
{!! csrf_field() !!}
<div class="form-group ">
<b><label class="control-label" for="name">Name</label></b>
<input type="text" class="form-control" id="name" name="name" value="{{ old('name') }}">
</div>
<div>
------------
</div>
<div class="form-group">
<b><label class="control-label" for="bio">A little about the expert</label></b>
</div>
<div class="form-group">
{{-- HERE IS THE PROBLEM THIS TEXT AREA HERE DOES NOT SEND VALUE --}}
<textarea type="text" class="kokoa" id="bio" name="bio"> {{ old('bio') }} </textarea>
</div>
<button type="submit" class="btn btn-primary pull-right">Submit</button>
<hr>
<a href="{{ route('home') }}">Back</a>
</form>

路线.php

Route::group(['prefix'  => 'experts'], function () 
{

Route::get('/add',['as'=>'add','uses'=>'ExpertsController@add']);

Route::post('/wee',['as'=>'creato','uses'=>'ExpertsController@create']);});

ExpertsController.php

public function add(){
$title = 'A new expert is born';
return view('add',compact('title'));

}


public function create(CreateExpertsRequest $request) {
$experts = Experts::create([
'name'=>$request->get('name'),
'bio'=>$request->get('bio')
]);

return redirect()->route('home');
}

创建专家请求

public function authorize()
{
return true;
}
public function rules()
{
return [
'name' => 'required',
'bio' => 'required',
];
}

最佳答案

我没有将其放入我的模型中......

expert.php(上一个)

    class Experts extends Model
{
protected $table = 'experts';
protected $fillable = [
'name',
];
}

现在

    class Experts extends Model
{
protected $table = 'experts';
protected $fillable = [
'name','bio'


];

}

关于javascript - 我的文本区域值不会进入数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35578198/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com