lundi 4 avril 2016

How to use WhereIn with Eloquent in laravel?

I want to used WhereIn method in Eloquent but it now work as below function

Messages: Call to undefined method Illuminate\Database\Query\JoinClause::whereIn()

 Class Notificatin extends Model{

 public function getNotification($user_id)
    {

        $this->_data = self::select('*')
            ->join('user_permission', function($join){
                $join->on('n_user_id','=','user_id')->whereIn('permission_id',array(90,91,92,93));
            })
            ->get();
        if (count($this->_data)) {
            return $this->_data;
        } else {
            return $this->_data;
        }
    }
   }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire