Download the PHP package thinkstudeo/laravel-rakshak without Composer

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

Rakshak - Two Factor Authentication & Authorization for Laravel 5.7+

Latest Version on Packagist Build Status StyleCI Quality Score SymfonyInsight Total Downloads

This package extends the authentication and authorization in a Lavarel application.

Contents

Installation

Then use the artisan command to install/integrate the package with your Laravel application.

The artisan command will:

Finally migrate the database bash $ php artisan migrate Migration will alter the users table to add

Migration will add two roles defined in the roles key of the config file. Only the User having role config('rakshak.roles.super_user') can access the /rakshak/settings route to view and edit the Two Factor settings. User having either config('rakshak.roles.super_user') or config('rakshak.roles.authorizer')

It is recommended to install the package in a fresh Laravel application

Config

Package config file is published at config/rakshak.php.

It allows to enable Two Factor Authentication - by default it is not enabled. It also allows to replace/modify the notification used for sending the otp and welcome message on registration.

The default notifications are published in the app/Notifications/Rakshak directory. You may modify or replace the notifications and then replace the corresponding config key with the FQCN of your new notification.

You can use any of the Laravel Notification channels for notifications. By default the package includes Textlocal Notification Channel for sms messaging.

Usage

The package provides the option to enable Two Factor Authentication as also the level of control i.e. once an administrator enables the 2fa module it can be applied to all users by the admin or each user can be given the option to enable 2fa for own use.

Two Factor Authentication

Route: /rakshak/settings is also provided for if you want to provide an easy way for other/client admins to control the Two Factor Authentication.

If you want to provide user level control for enabling/disabling Two Factor Authentication, you will need to implement:

HasRakshak trait

The User.php file - as per the config('auth.providers.users.model') is updated to use the HasRakshak trait. The trait provides a number of functions and roles relation to the User.

Adding and Retracting Ability to a Role

Assigning and Retracting Role to User

Check if the User has role

Check if the User has any of given multiple role

Check if the User has ability

Check if the User has any of given multiple abilities

Roles and Abilities

Route: /rakshak/roles will provide a list of all existing roles

Route: /rakshak/roles/{role}/edit will provide the edit role form

Route: /rakshak/roles/create will provide the create new role form

Similarly the corresponding routes for Abilities are also provided for easy crud operations.

All package views are published to resources/views/vendor/rakshak directory.

Route Middleware

A route middleware role is registered by the package.

To protect the routes with valid opt, use the rakshak.2fa middleware.

Once Two Factor Authentication is enabled, and rakshak.2fa middleware is applied to any route, it will check for a valid otp associated with the user.

Once the generated otp is sent to the user and user verifies the login with otp it will stay verified till session lifetime.

Blade Directives

If you want to check against multiple roles, there's another directive where you can check against multiple roles separated by |

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-rakshak with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
doctrine/dbal Version ^2.9
guzzlehttp/guzzle Version ^6.3
illuminate/support Version 5.7.*|5.8.*|5.9.*
moontoast/math Version ^1.1
thinkstudeo/textlocal-notification-channel Version ^1.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 thinkstudeo/laravel-rakshak contains the following files

Loading the files please wait ....