github JosephSilber/bouncer v1.0.0-beta.4

latest releases: v1.0.2, v1.0.1, v1.0.0...
pre-release6 years ago

New

  • Support Laravel 5.5 🎉

  • Sync roles (retract any roles not in the list, and assign all roles in the provided list):

    Bouncer::sync($user)->roles(['admin', 'reviewer']);
    
    // You can also pass in role IDs:
    Bouncer::sync($user)->roles([1, 2]);
    
    // Or role models, if you already have them:
    Bouncer::sync($user)->roles([$adminModel, $reviewerModel]);
  • Sync abilities (disallow any abilities not in the list, and allow all abilities in the provided list):

    Bouncer::sync($user)->abilities(['access-dashboard', 'ban-users']);
    
    // You can also pass in ability IDs:
    Bouncer::sync($user)->abilities([1, 2]);
    
    // Or ability models, if you already have them:
    Bouncer::sync($user)->abilities($abilityModels);
    
    // Or a map of abilities:
    Bouncer::sync($user)->abilities([
        'create' => User::class,
        'delete' => Post::class,
    ]);

Don't miss a new bouncer release

NewReleases is sending notifications on new releases.