Skip to content
Discussion options

You must be logged in to vote

@realtebo we use the model to get the options, you add the constrain in the relation for the pivot table, not the model.

You can configure the options like in any other select:

'pivotSelect' => [
    'options' => function($model) {
        return $model->whereIn('id', [1,2]);
    },
],

Cheers

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@realtebo
Comment options

@pxpm
Comment options

pxpm Aug 10, 2023
Maintainer

@realtebo
Comment options

@pxpm
Comment options

pxpm Aug 10, 2023
Maintainer

Answer selected by realtebo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants