Easiest way to cast pivot table in Laravel Eloquent? -
what easiest way cast pivot table in laravel?
class product{ public function sales(){ return $this->belongstomany(sale::class) ->withpivot('qty', 'price'); } }
when return price string, need change int.
Comments
Post a Comment