2016-10-18 2 views
1

분류, 포드, 샘플링, 후속 작업의 4 개의 새로운 열로 내 노트 테이블을 업데이트했습니다.Laravel 5.2 updated table now model now

나는 (여전히 다음과 같이 작동)과 같이 내 모델을 업데이트 할 것입니다 :

$note->account_id  = $account->id; 
$note->name    = $request->input('account-note-title'); 
$note->description  = $request->input('account-note-description'); 
$note->save(); 

을하지만 시도 할 경우 실패 새로운 컬럼에 게시 할 수 있습니다.

$note->account_id  = $account->id; 
$note->name    = $request->input('account-note-title'); 
$note->description  = $request->input('account-note-description'); 
$note->classification = $request->input('account-note-classification'); 
$note->pod    = $request->input('account-note-pod'); 
$note->sampled   = $request->input('account-note-samplebrand'); 
$note->followup   = $request->input('account-note-followup-date'); 
$note->save(); 

모델 등을 새로 고쳐야합니까?

+0

는 오류가 무엇을 표시됩니다? – xmhafiz

+0

제 PHP 콘솔이 오류를 로깅하지 않습니다 – Packy

+0

디버그 모드를 활성화 하시겠습니까? 데이터베이스에 테이블이 있습니까? – xmhafiz

답변

0

당신은 MODELNAME은 : ($ 요청 -> 모든())이 모델의 $ 채울 수있는 변수에 모든 입력 필드를 넣어야 할이 경우 만들 아래 같은 메도 만들기 laravel 사용하여 새로운 가치를 만들 수 있습니다. 다음과 같은 방법 $ 모델 = findOrFail ($ 아이디) $ 모델 -> 업데이트를 사용하여 항목을 업데이트 할 수 있습니다 ($ 요청 -> 모든())