Skip to content

1. Introduction and Installation

kurosawa93 edited this page Dec 27, 2018 · 4 revisions

Introduction

Ramenauth is a custom library which is created by Ordent. It features many function covering basic needs for authentication, like registering new user, login, user validation, token generation, etc. It also has features like custom rules regarding user, email and phone verification.

Install via Composer

composer require ordent/ramenrest

right now you need to add "minimum-stability" : "dev" in your composer.json

Update Project Configuration

Wire your current project to the newly added ramenauth using RamenAuthProvider. Add Ordent\RamenAuth\Providers\RamenAuthProvider::class to config/app.php. run php artisan config:cache to refresh our cache and rebuild the cache with your newly added ramenauth.

Migration

After updating your project configuration, and making sure your cache is refreshed, migration is ready to run. run php artisan migrate if your database configuration is in .env, or php artisan migrate --env=example if your database configuration is in .env.example. This command will run any current pending migration, and also migration files for ramenauth. Check your database if the process is finished, there should be tables like this:

- permissions
  
- roles
  
- model_has_permissions
  
- model_has_roles
  
- role_has_permissions
  
- ramen_verifications
  
- ramen_forgottens

Those are the tables that will be utilized by ramenauth.

Publish

Check your project config files under config/. There should be a file named ramenauth.php besides any other files. If there is no such a file, you can generate them manually by running php artisan vendor:publish, and type the number of Ordent\RamenAuth\Providers\RamenAuthProvider and then enter. The files should be generated by now.

Mandatory Field

In order to use all functionality of ramenauth, there is some mandatory field that you must add into fillable section of User model, and your migration table for users. Those field are:

status:integer (in order to save current user status)

phone:text (in order to use feature related to phone)

authentication_code:text (in order to use phone login verification)

The data type was used for 'migration' files. As for the fillable, you don't need to specify the type.

Clone this wiki locally