我认为这很可能是PHP错误,并且我发现了一些帖子也有相同的错误,但是我无法从这些问题的答案中解决问题。
我的密码
class consultController extends Controller
{
public function index(){
return view('pages.consult');
}
public function find(){
$input=Request::all();
$location=$input['location'];
$spec=$input['specialization']
$out = DB::table('doctors')->where('location','=', $location)
->where('specialization_group','=', $specialization)
->get(); //line 23, error here
return $out;
}
}
错误:
FatalErrorException in consultController.php line 23:
syntax error, unexpected '$out' (T_VARIABLE)
用分号解决错误后,我现在收到此错误,
ErrorException in Factory.php line 153:
array_merge(): Argument #2 is not an array
尝试将$ out传递给视图时,
class consultController extends Controller
{
public function index(){
return view('pages.consult');
}
public function find(){
$input=Request::all();
$location=$input['location'];
$spec=$input['specialization'];
$out = DB::table('doctors')->where('location','=', $location)
->where('specialization_group','=', $spec)
->get();
return view('pages.doclist')->with('out',$out);
//return count($out);
}
}
分号$spec=$input['specialization']
在行中丢失。
它看起来应该像这样:
$spec=$input['specialization'];
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句