D
I've been using scopes inside with clauses etc for a very long time, I don't think this is needed. I believe it is not working for you simply because you are not returning the $query object from the scope, it should be: public function scopeWithCalculatedPricing ( $query, $include_tax = false ) { $tax_multiplier = $include_tax ? 1.2 : 1 ; return $query->selectRaw( 'products.*, ( products.price * ' . $tax_multiplier . ' ) as total_price' ) ->where( 'stock' , '>' , 0 ); } Please note the added return . If you can see if you refer to the laravel docs on the subject: https://laravel.com/docs/5.4/eloquent#local-scopes