所以,我想在一张表中插入数据,但出现此错误我真的不t know why. i熟悉 Laravel,请帮助:D
这是我的路线
Route::get('/adaugajob', 'Auth\AdaugaJobController@create')->name('adaugajob');
这是我的控制器
protected function validator(array $data)
{
if ($data) {
return Validator::make($data, [
'titlu' => ['required', 'string', 'max:255'],
'descriere' => ['required', 'string', 'max:255'],
'salariu_estimativ' => ['required', 'string', 'max:255'],
'oras' => ['required', 'regex:^[0-9\-\+]{9,15}$^'],
]);
}
}
protected function create(array $data)
{
if ($data) {
Joburi::create([
'titlu' => $data['titlu'],
'descriere' => $data['descriere'],
'salariu_estimativ' => $data['salariu_estimativ'],
'oras' => $data['oras'],
]);
}
}
手掌心
LEATH