Skip to content

Conversation

Toylycker
Copy link

There is a cases where developer creates model Role in app\models extending Role of the spatie to be able to add more fns. for example:

There is a cases where developer creates model Role in app\models extending Role of the spatie to be able to add more fns. for example:

<?php

namespace App\Models;

use Spatie\Permission\Models\Role as SpatieRole;
use Illuminate\Database\Eloquent\Casts\Attribute;
use App\Enums\RolesEnum;
class Role extends SpatieRole
{
//fns you want model to have
}


In that scenario getStoredRole function returns error asking return type to be exactly Spatie\Permission\Models\Role. This patch fixes it.
@Toylycker Toylycker closed this Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant