Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $candidates = Job::where('enterprise_id', $enterprise_id)
- ->where('id', $jobid)
- ->with('candidates')
- ->first();
- AppJob
- public function candidates(){ //llamar candidates desde el with del controlador.
- //En este modelo necesito hacer paginación, ya que es donde se obtenien más resultados, en tabla muchos a muchos.
- return $this->hasMany('AppJobCandidate')->with('candidate');
- }
- AppJobCandidate
- public function candidate(){ //llamar candidate desde el modelo AppJob
- //Obtención de información de usuario.
- return $this->hasOne('AppUser', 'id', 'user_id');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement