Giter Site home page Giter Site logo

Comments (7)

IlCallo avatar IlCallo commented on July 17, 2024 1

No problem! Even if it seems strange that the migration command doesn't work

from laravel-permission.

IlCallo avatar IlCallo commented on July 17, 2024

Hi, no I'm not planning to.
I still hope they'll consider adding this feature to their official package but they repeatedly said they are not interested (even in PRs).
This is a "divergent" branch which also have a different version numeration (I did not even changed the package name, you have to reference this repo directly to use this).

If you want to try to take this back in sync with the original package, feel free to PR, but I'm not planning to do it :)

from laravel-permission.

meanmachin3 avatar meanmachin3 commented on July 17, 2024

I am new to php and laravel.

Do you mind sharing steps to add this package to current project ?
I've tried adding repositories and referenced your package. Downgrade spatie package to 2.2.0 and did a composer update. It still refers to old package. Am I missing something ?

from laravel-permission.

IlCallo avatar IlCallo commented on July 17, 2024

Because this package is not published on packagist register, you must register a private repo endpoint in your composer.json file.

You can find how to do it in composer documentation.
I don't know if you also need to generate a GitHub token to add a custom repo, probably yes.

from laravel-permission.

meanmachin3 avatar meanmachin3 commented on July 17, 2024

@IlCallo Thanks for all your response and help.

Yes, you were right, I had generate Github token and added this repo.

Whenever I try to publish a migration, I am unable to do so.

php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="migrations"

I tried running the above command, I cannot see any migration published. Should I add a migration file manually ?

Manually adding migration helped.

Class Spatie\Permission\Middlewares\RoleMiddleware does not exist

However, I get the following error.

Sorry for all trouble.

Many thanks for help !

from laravel-permission.

meanmachin3 avatar meanmachin3 commented on July 17, 2024

Hi @IlCallo

Sorry for bothering yet again, while trying to pass restrictable entity, I've noticed that it doesn't creates entry for that resource. Looks like I am missing something.

Do I need to implement Restrictable in to my resource like

class Project extends Model implements Restrictable

or do I need to add a trait ?

I've tried both ways and was successful in getting restrictable resource's id and table name, however whenever I try to give it permission, restrictable columns in model_has_permissions is empty.

Thanks for help in advance !

from laravel-permission.

IlCallo avatar IlCallo commented on July 17, 2024

Hi, check out this for usage (you should implement Restrictable interface and you could use the already provided RestrictableTrait if it fits your needs).

To specify a restrictable model, you should pass it as second argument (eg. $user->assignRole('writer', $department))

from laravel-permission.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.