PHP code example of oliuz / teamroles

1. Go to this page and download the library: Download oliuz/teamroles library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

oliuz / teamroles example snippets


'providers' => [
    
    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...
    
    /**
     * Third Party Service Providers...
     */
    Tehcodedninja\Teamroles\TeamRoleProvider::class,
],

 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
}

'providers' => [
    
    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...
    
    /**
     * Third Party Service Providers...
     */
    Tehcodedninja\Teamroles\TeamRoleDemoProvider::class,
],
bash
composer dump-autoload