JosephSilber / bouncer

Laravel Eloquent roles and abilities.
MIT License
3.43k stars 330 forks source link

Bouncer::role() return empty array #627

Open oksim14 opened 1 year ago

oksim14 commented 1 year ago

Hello, I have a little issue.

I'm using laravel/framework v9.52.6 , but tried on v10 with same results.

Bouncer version "silber/bouncer": "v1.0.0", - all works fine:

In tinker:

$roles = Bouncer::role()->pluck('name');
= Illuminate\Support\Collection {#8519
    all: [
      "admin",
      .... many more roles here

After update to version "silber/bouncer": "v1.0.1", nothing else changed and result is:

$roles = Bouncer::role()->pluck('name');
= Illuminate\Support\Collection {#8260
    all: [],
  }

This is for me critical, because I need update to laravel 10 and in seeder it works (doesn't works) same like in tinker (empty array).

Thank you

JosephSilber commented 1 year ago

That doesn't sound right 😮

Can you create a small demo repository that recreates this issue?

JosephSilber commented 1 year ago

BTW, are you using scopes? Have you seen #628? Do you think it's the same change causing it?