Download the PHP package codersvn/usermanagement without Composer

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

User Component for Laravel and Lumen

The User Component package provides a convenient way of managing application's users.

Table of content

Installation

Composer

To include the package in your project, Please run following command.

Once the package is installed, the next step is dependant on which framework you are using.

Service provider

Laravel

In your config/app.php add the following Service Providers to the end of the providers array:

Lumen

In your bootstrap/app.php add the following Service Providers.

You also need to define route in bootstrapp/app.php.

Config and Migration

Laravel

Run the following commands to publish configuration and migration files.

Create tables.

Please delete the Laravel default users migration file to avoid conflict when running the migrate command.

Make a change in config/auth.php.

Lumen

Create config/auth.php file and add the following contents.

Create the following migration files.

Add these following contents to those corresponding migration files

Create tables.

Environment

In .env file, we need some configuration.

Generate JWT_SECRET in .envfile.

Now the package is ready to use.

Configuration

URL Namespace

To avoid duplication with your application's api endpoints, the package has a default namespace for its routes which is user-management. For example:

You can modify the package url namespace to whatever you want by modifying the USER_MANAGEMENT_NAMESPACE variable in .env file.

User Model

You can use your own User model by modifying config/auth.php

Your User model must has the following content.

User Transformer

Laravel

You can use your own UserTransformer class by modifying config/user.php.

Lumen

Create config/user.php with the following content.

Now you can modify UserTransformer class.

Social login

To be able to use social login api provided by the package, you have to add these configuartion to config/services.php

User Model

User Schema

By default, the package provides some very basic fields in users table. In your application, you may want to have your own fields in users table to meet your application's requirements. It can be solved thanks to the User Meta system within the package which holds any additional fields datas you include.

The package provides a way to describe your additional fields throught schema() method. In schema(), you'll need to define your field name, field type and field validation rule.

All you need to do is declaring schema() method in your User model.

User Management

In your application, you may want to determine if the user is granted to access user resources. The package provides UserManagementTrait which contains the logic for granting access. The UserMangementTrait contains 5 methods: ableToShow(), ableToCreate(), ableToUpdate(), ableToUpdateProfile(), ableToDelete(). These methods will execute the checking logic and then return boolean value.

To overwrite the default logic with your own, all you need to do is declaring these methods within your User model.

Take a look at VCComponent\Laravel\User\Traits\UserManagementTrait for more details of these methods.

APIs List

Here is the list of APIs provided by the package.

Verb URI Action
POST /api/{namespace}/register register
POST /api/{namespace}/login login
POST /api/{namespace}/login/social social login
GET /api/{namespace}/me get profile
PUT /api/{namespace}/me/avatar update avatar
PUT /api/{namespace}/me/password update password
POST /api/{namespace}/password/email forgot password
PUT /api/{namespace}/password/reset reset password
------ ------ ------
GET /api/{namespace}/admin/users index
GET /api/{namespace}/admin/users/all list all
POST /api/{namespace}/admin/users store
GET /api/{namespace}/admin/users/{id} show
PUT /api/{namespace}/admin/users/{id} update
DELETE /api/{namespace}/admin/users/{id} destroy
PUT /api/{namespace}/admin/users/status/bulk bulk update status
PUT /api/{namespace}/admin/users/status/{id} update item status
------ ------ ------
GET /api/{namespace}/users index
GET /api/{namespace}/users/all list all
GET /api/{namespace}/users/{id} show
PUT /api/{namespace}/users/{id} update
PUT /api/{namespace}/users/{id}/verify-email verify email
GET /api/{namespace}/users/{id}/is-verified-email is verified email
POST /api/{namespace}/users/{id}/resend-verify-email resend verify email

Routing

Custom Routing

To use your own routes, you need to remove VCComponent\Laravel\User\Providers\UserComponentRouteProvider within config/app.php.

Now you can manually create and use your own routes.

Custom Controller

You are free to use your own UserController to customize the API functionality.

To make sure that your changes won't crash the other functionality, your UserController need to extend VCComponent\Laravel\User\Http\Controller\ApiController and use UserAdminMethods trait for admin controller, UserFrontendMethods trait for frontend controller.

Additional Configuration

The package contains 3 other packages which are dingo/api, tymon/jwt-auth, prettus/l5-repository.

Other configurations of these packages, please follow their documentation.


All versions of usermanagement with dependencies

PHP Build Version
Package Version
Requires dingo/api Version 2.0.0-alpha1
prettus/l5-repository Version ^2.6
tymon/jwt-auth Version ^1.0@dev
laravel/socialite Version ^3.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 codersvn/usermanagement contains the following files

Loading the files please wait ....