Guest User

Untitled

a guest
Jan 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. $builder->join('pivot_table', function($join){
  2. $join->on('vehicle.id','=','pivot_table.model_id')
  3. ->on('pivot.model_type', Vehiculo::class );
  4. })->select('vehicle.*',pivot_table.*)->get();
  5.  
  6. $builder->join('pivot_table', function($join){
  7. $join->on('vehicle.id','=','pivot_table.model_id')
  8. ->on('pivot.model_type', 'like' , '%Vehiculo%');
  9. })->select('vehicle.*',pivot_table.*)->get();
Add Comment
Please, Sign In to add comment