2017 © Pedro Peláez
 

library teamroles

Team Roles expansion on mpociot/teamwork

image

tehcodedninja/teamroles

Team Roles expansion on mpociot/teamwork

  • Thursday, November 24, 2016
  • by tehcodedninja
  • Repository
  • 2 Watchers
  • 13 Stars
  • 15 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

Team Roles for mpociot/teamwork

Installation

This package is very easy to setup and install., (*1)

Composer

Pull this package in through Composer (file composer.json)., (*2)

{
    "require": {
        "tehcodedninja/teamroles": "1.0.3-alpha"
    }
}

The run composer install or composer update. Alternatively you can run composer require tehcodedninja/teamroles to install this package., (*3)

Service Provider

Add the package to your application service providers in config/app.php file., (*4)

'providers' => [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...

    /**
     * Third Party Service Providers...
     */
    Tehcodedninja\Teamroles\TeamRoleProvider::class,
],

Config File And Migrations

Publish the package config file and migrations to your application. Run these commands inside your terminal., (*5)

php artisan vendor:publish --provider="Tehcodedninja\Teamroles\TeamRoleProvider" --tag=config
php artisan vendor:publish --provider="Tehcodedninja\Teamroles\TeamRoleProvider" --tag=migrations

And also run migrations., (*6)

php artisan migrate

Models

User

Add the UsedByUsers trait to your existing User model:, (*7)

<?php namespace App;

use Mpociot\Teamwork\Traits\UserHasTeams;
use Tehcodedninja\Teamroles\Traits\UsedByUsers;

class User extends Model {
    use UserHasTeams;
    use UsedByUsers {                                                                       // Add these lines starting here
        UsedByUsers::isOwnerOfTeam insteadof UserHasTeams;     // 
    }                                                                                                     // Till here
}

This will enable the relation with TeamRoles and add the following methods teamRoles(), teamRoleFor($team) isOwnerOfTeam($team), CurrentTeamRole(), isTeamRole($team_role), updateTeamRole($team_role, $team) within your User model., (*8)

Don't forget to dump composer autoload, (*9)

composer dump-autoload

Scaffolding

The easiest way to give your new Laravel project Team Role abilities is by adding the demo application service provider in config/app.php file., (*10)

'providers' => [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...

    /**
     * Third Party Service Providers...
     */
    Tehcodedninja\Teamroles\TeamRoleDemoProvider::class,
],

Adding this service provider links all the Models/Views/Controllers to you application without moving anything., (*11)

The demo provides you everything like TeamWork does but with the ability to assign roles to people for each team:, (*12)

  • Team listing
  • Team creation / editing / deletion
  • Invite new members to teams
  • Team Role creation / editing / deletion
  • Change members' role

To get started, take a look at the new installed /teamroles and /admin/teamroles in your project., (*13)

The Versions

24/11 2016

dev-master

9999999-dev https://github.com/tehcodedninja/TeamRoles

Team Roles expansion on mpociot/teamwork

  Sources   Download

MIT

The Requires

 

roles teamwork teamroles

15/11 2016

1.0.3-alpha

1.0.3.0-alpha https://github.com/tehcodedninja/TeamRoles

Team Roles expansion on mpociot/teamwork

  Sources   Download

MIT

The Requires

 

roles teamwork teamroles