So i am trying to send some query from the controller to a view but when try use the third variable it says:
Undefined variable: type(View:)
You should return one array :
return view('dashboard',['doc'=>$doc,'user'=>$user,'type'=>$type]);
There is other ways such us :
return view('dashboard', array('doc'=>$doc,'user'=>$user,'type'=>$type));
return view('dashboard', compact('doc','user','type'));
return view('dashboard')
->with('doc', $doc)
->with('user', $user)
->with('type', $type);
return view('dashboard') //using laravel Magic method.
->withDoc($doc)
->withUser($user)
->withType($type);