Skip to content

Assign role during registration process #14664

Answered by leandrocfe
jordantsap asked this question in Help
Discussion options

You must be logged in to vote

use

Select::make('roles')
    ->multiple()
    ->relationship('roles', 'name', modifyQueryUsing: function ($query) {
        $query->whereIn('id', [4, 5, 6, 7]);
    })
    ->preload()
    ->default([4])

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jordantsap
Comment options

@leandrocfe
Comment options

Answer selected by jordantsap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants