Laravel 5 issue with wherePivot
PHP Snippet 1:
SomeModel::newQuery()
PHP Snippet 2:
$this->states()
PHP Snippet 3:
public function scopeWithPendingReviews($query) {
$query->join('pose_state', 'poses.id', '=', 'pose_state.pose.id')
->where('status_id', 10);
}
PHP Snippet 4:
$poses = Pose::withPendingReviews();
PHP Snippet 5:
$poses = Pose::newQuery()->withPendingReviews();
PHP Snippet 6:
->wherePivot('status', 10);
PHP Snippet 7:
$task = App\Models\PricingTask::find(1);
$task->products()->wherePivot('taggable_type', 'product')->get();