Download the PHP package codelabmw/teams without Composer

On this page you can find all versions of the php package codelabmw/teams. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package teams

Teams

A laravel package from Codelab that handles team management business logic onbehalf of your laravel application. It can be used with any UI framework.

The main purpose of the package is to provide resource sharing as well as compartmentalization of the shared resources.

Installation

To add the package in your laravel project run the following command.

composer require codelabmw/teams

After the installation, run the following command to publish the migration and config files.

php artisan vendor:publish --tag=codelab-teams

And then run the following command to create necessary tables.

php artisan migrate

Usage

Creating a team

To start creating teams, in your model acting as a team entity (the model of your choice to have teams) add the HasTeam trait.

Once you have your entity configured you can then create teams using the teams relationship method or the provided helper method.

  1. Using the team's entity teams relationship method.

  2. Using the team's entity createTeam helper method.

The create or createTeam functions expects the following fields.


name: The team name. Required.

slug: Usually the name in lowercase and hyphanated. Optional.

description: An optional description of the team. Optional.

status: An integer between 1 and 2 indicating whether the team is active or inactive respectively. Defaults to 1 (Active). You can the Status enum provided by the package.


You can find a comprehensive list of helper methods here

Adding members to team

To add a member to a team first you have to add the IsMember trait to your model acting as a member entity.

By default the package will assume that the App\Models\User class is the member entity. This behavior can be changed in the config file, specify your own member entity class on the member attribute.

Once you have your member entity configured, you can proceed to add members to a team by using either of the following options.

  1. Using the team's object members relationship method.

  2. Using the team's object addMember helper method.

    The addMember method requires the members id as an int or string.

  3. Using the member's object joinTeam helper method.

    The joinTeam method requires the teams id as an int or string.

You can find a comprehensive list of helper methods here

Adding resources to team

Because the package does not know how many and what kind of resources your application will have, things have to be done manually. Following are the steps to adding resource sharing.

First add the IsResource trait to the resource entity (model class acting as a resource) in your application.

Secondly extend the base Codelab\Teams\Models\Team class in a custom team class.

To let the package know of the new custom class, change the team attribute in the config file.

And then finally create a relationship between the resource and the team in the new custom team class using the morphByResource method.

Once all this is done you can go ahead to add resources to team objects using the relationship method you just created.

Glossary

Helper methods

On the object that has teams

On a team object

On a member object

On a resource object


Thank you for checking out the package, don't forget to share and :star2: if you liked it :grin:.


All versions of teams with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version >=10.0 ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codelabmw/teams contains the following files

Loading the files please wait ....