Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $builder->join('pivot_table', function($join){
- $join->on('vehicle.id','=','pivot_table.model_id')
- ->on('pivot.model_type', Vehiculo::class );
- })->select('vehicle.*',pivot_table.*)->get();
- $builder->join('pivot_table', function($join){
- $join->on('vehicle.id','=','pivot_table.model_id')
- ->on('pivot.model_type', 'like' , '%Vehiculo%');
- })->select('vehicle.*',pivot_table.*)->get();
Add Comment
Please, Sign In to add comment