Download the PHP package autn/gcl-users without Composer

On this page you can find all versions of the php package autn/gcl-users. 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 gcl-users

Laravel Users Module

Build Status

This module is use JWTAuth and ENTRUST libraries

  1. https://github.com/tymondesigns/jwt-auth (JSON Web Token)
  2. https://github.com/Zizaco/entrust (Role-based Permissions)
  3. https://github.com/php-soft/laravel-users (Users manager)

1. Installation

Install via composer - edit your composer.json to require the package.

Version Compatibility

GclUsers Laravel
1.x 5.1.x
2.x 5.2.x

Then run composer update in your terminal to pull it in. Once this has finished, you will need to add the service provider to the providers array in your app.php config as follows:

Next, also in the app.php config file, under the aliases array, you may want to add facades.

You will want to publish the config using the following command:

Don't forget to set a secret key in the jwt config file!

I have included a helper command to generate a key as follows:

this will generate a new random key, which will be used to sign your tokens.

2. Migration and Seeding

Now generate the migration:

It will generate the <timestamp>_entrust_setup_tables.php migration. You may now run it with the artisan migrate command:

Running Seeders with command:

Note: Run seeders after use UserTrait in your existing App\User model, follow 3.2 below

3. Usage

3.1. Authenticate with JSON Web Token

You need to change class App\User to inherit from Gcl\GclUsers\Models\User as follows:

Remove middlewares in app/Http/Kernel.php

Add route middlewares in app/Http/Kernel.php

Add routes in app/Http/routes.php

Note: You can add this to your middleware groups api

Apache seems to discard the Authorization header if it is not a base64 encoded user/pass combo. So to fix this you can add the following to your apache config

Alternatively you can include the token via a query string

3.2. Role-based Permissions

Use the UserTrait trait in your existing App\User model. For example:

Create Role and Permission follows

Now we can check for roles and permissions simply by doing:

Both hasRole() and can() can receive an array of roles & permissions to check:

3.3 Forgot password

To send mail forgot password,

You can change contents of this view for your using.

By other way, you can use other view and config password.email in config\auth.php:

3.4 Middlewares

Gcl\GclUsers\Middleware\RoutePermission

This middleware is used to check permission for a route dynamic by database.

Add route middlewares in app/Http/Kernel.php

Usage

Require permission for a route as follows

Gcl\GclUsers\Middleware\Validate

This middleware is used to check validate for fields on different applications which use this package.

Add route middlewares in app/Http/Kernel.php

Usage

With App\Http\Validators\UserValidate, it's class which you need to declare in route. This class is used to declare rules to validate.

You can also use other class to declare rules for validate in your application but It have to implements Gcl\GclUsers\Contracts\Validator class.

For example, I declared rules in App\Http\Validators\UserValidate class as follows:

Here, you will declare fields that you want to validate them in rules() function. And You can also custom validator fields that you want by declare them in boot() function.


All versions of gcl-users with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
laravel/framework Version 5.2.*
php-soft/laravel-array-view Version 1.1.4
tymon/jwt-auth Version 0.5.*
zizaco/entrust Version dev-laravel-5
doctrine/dbal Version ^2.5
baum/baum Version ~1.1
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 autn/gcl-users contains the following files

Loading the files please wait ....