나는 데이터베이스에서 값을 가져 와서 드롭 다운에 표시하려고합니다.이 오류는 undefined variable usertype..i이 어디서 오류인지 이해할 수 없습니다.laravel5.4에서 정의되지 않은 변수
<div class="form-group">
<label for="cat">User Type</label>
<select class="form-control" name="user_type_id">
@foreach($usertype as $user)
<option id="user_type_Id" value="{{$user->id}}" selected="selected">{{ $user->type }}</option>
@endforeach
</select>
</div>
누군가가 나를 도울 수 ..
: 여기public function get() {
$usertype = DB::table('user_type')->get();
return View::make('/home')->with(compact('user_type'));
return $usertype;
}
내보기 드롭 다운입니다 : 여기
내 컨트롤러입니다 .. laravel 프레임 워크에 새로운 오전
함수에서 2가 반환됩니다. 두 번째 실행은 결코 실행되지 않습니다 –
왜 실행되지 않습니까? – bharathi
laravel에 대해서는 알지 못하지만 모든 프로그래밍 언어에서 .. 처음 실행되는 return 문은 함수를 종료하고 해당 값이 사용됩니다. –