0
드롭 다운 목록을 올바르게 가져 오는 중입니다. 그러나 페이지를 새로 고친 후 드롭 다운 목록의 모든 값은 디 서퍼입니다.새로 고침 후 드롭 다운 목록 disapper
public function SecondLogin(Request $request){
$view = property_exists($this, 'loginView')
? $this->loginView : 'auth.authenticate';
if (view()->exists($view)) {
return view($view);
}
$email1=session::pull('shop_id');
$employee_email=session::pull('employee_email');
$main_shop=User::with('user_details')->where('email', $email1)->first();
$employee_list=session::pull('employee_list');
$employee_list = User::Orwhere('id',$main_shop['id'])->Orwhere('shop_parent_id',$main_shop['id'])->where('status',1)->get();
return view('auth.secondlogin')->with([ 'employee_list' => $employee_list,'email1'=>$email1,'main_shop'=>$main_shop,'employee_email'=>$employee_email]);
}
보기 :
<div class="form-group">
<select name='employee_Id' class="form-control">
<option class="category" value="" >-Select your name-</option>
@foreach($employee_list as $employee)
<option class="category" value= "{{ $employee->id }}" @if($employee_email==$employee->email) selected='selected' @endif>{!! $employee->name !!}</option>
@endforeach
</select>
</div>
잘못 무슨 일이 일어나고 있는지 이해하지
여기 내 컨트롤러 코드입니다. 어떤 도움이 크게 Appriciated 것입니다.