Skip to content

assignRole() not working well when change role_pivot_key #2043

Answered by erikn69
nausixkiz asked this question in Q&A
Discussion options

You must be logged in to vote

First, always put php(js,html depends) after ``` for readability (```php), example

/**
 * Determine whether the user can show the model.
 *
 * @param  \App\Models\User  $user
 * @param  \App\Models\User  $model
 * @return \Illuminate\Auth\Access\Response|bool
 */
public function show(User $user, User $model)
{
    return $user->can('view-user');
}

Second, this package not fully support uuid,
also you can't change field name id to uuid, go back to id
#1909 in the past I did a PR for this, but it wasn't merged, maybe it can help you

Maybe

// In Laravel 6.0+ make sure to also set $keyType
protected $keyType = 'string';

https://github.com/spatie/laravel-permission/blob/main/docs/advanced-usag…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nausixkiz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants