Download the PHP package californiamountainsnake/simple-laravel-auth-system without Composer

On this page you can find all versions of the php package californiamountainsnake/simple-laravel-auth-system. 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 simple-laravel-auth-system

simple-laravel-auth-system

A simple realisation of authentication and authorization for Laravel

Install:

Require this package with Composer

Install this package through Composer. Edit your project's composer.json file to require californiamountainsnake/simple-laravel-auth-system:

and run composer update

or

run this command in your command line:

Usage:

  1. Extend Enum classes: (AuthLangsEnum, AuthUserAccountTypeEnum, AuthUserRoleEnum).
  2. Extend the AuthUserAvailableActions class. You can add there any checks based on some user, like (new UserAvailableActions($user))->isSomeActionAvailableForThisUser().
  3. Extend the AuthUserEntity class. This your main user class. See https://github.com/CaliforniaMountainSnake/php-database-entities.
  4. Extend the AuthUserRepository class. This is the repository contains all user database queries in any from. See https://github.com/CaliforniaMountainSnake/php-database-entities.
  5. Extend the AuthValidatorService class contains the Laravel validation array for api_token request param. Like:

  6. Add some binding in Laravel AppServiceProvider:

  7. Extend the AuthApiUserController class and create your own base api controller. Realise the abstract methods. All actions of this controller (and it's children) will be automatic handled by the auth system.

  8. Now you can add your routes into the www/routes/api.php file like this:

  9. Catch the MethodNotAllowedException in the App\Exceptions\Handler::render():

  10. Create a language file (/resources/lang/en/auth_middleware.php) with api error messages:
    • auth_middleware.method_not_allowed
    • auth_middleware.no_token_error
    • auth_middleware.bad_token_error
    • auth_middleware.wrong_role_error
    • auth_middleware.wrong_account_type_error
  11. That's all)

All versions of simple-laravel-auth-system with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
ext-json Version *
myclabs/php-enum Version ~1.5
laravel/framework Version ~5.7|~6.0|~7.0
californiamountainsnake/json-response Version ~1.0.1
californiamountainsnake/php-database-entities Version ~1.0.0
californiamountainsnake/php-utils Version ~1.0.7
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 californiamountainsnake/simple-laravel-auth-system contains the following files

Loading the files please wait ....