mercredi 1 novembre 2017

if query returning a return error laravel

I need some help with this query, I don't understand why am I getting this error "Parse error: syntax error, unexpected 'return'(T_RETURN)" even though my previous line was working. I checked on other question similar to this error and see if I have similar mistake but I don't think so, I even double checked to see if I am missing any bracket in my query. Can someone please help me? Thanks a lot.

This part of the code work, "if(count($data)>0){" but when I changed to this it doesn't work anymore " if (hire::where('hire_status','Yes'->count($data) > 0){"

Controller:

     public function getHire(){
        $data['data'] = DB::table('personal_infos')->where('deleted_at',NULL)->get()->sortByDesc('created_at');
        if (hire::where('hire_status','Yes'->count($data) > 0){
       // if(count($data)>0){
        return view('hire',$data);
    }else{
    return view('hire');
}

Aucun commentaire:

Enregistrer un commentaire