Download the PHP package bluecloud/laravel-security-question without Composer
On this page you can find all versions of the php package bluecloud/laravel-security-question. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bluecloud/laravel-security-question
More information about bluecloud/laravel-security-question
Files in bluecloud/laravel-security-question
Package laravel-security-question
Short Description Helpers for managing security questions within your Laravel project
License MIT
Informations about the package laravel-security-question
Introduction
Laravel security questions helps you easily integration security question facility for your project
Installation
Migrate Tables
Run the following command to create tables to enable saving security questions
Publish Config
The package allows you to publish a config file to change settings for the package. Run the command below and select . A configuration file will be created at
Load Questions
Run the following command
Adding Trait to User
Add the trait to your model as indicated below.
Add Question(s) for User
To add question(s) for a user, add the code below
Checking Question Answer
To check a user's submitted answer against the saved answers, add the code below
Note: The questions will sync. If the question was already attached for the user, the new answer will update the existing record
Routes
To manage question, you can make use of preconfigured api endpoints
1. List Security Question
2. Create Security Question
3. Delete Security Question
Configuration
Change package settings
1. Default Questions
Navigate to and find default security questions. You may change if you please.
2. Strict Mode
By default, the package turns off. When strict mode is off, the package ignores case for the answers and removes all whitespaces and special characters to ease the matching of user submitted answers. If you want the answers to match exact case and whitespace, turn on in
3. Middleware
To protect routes, and middleware in . For example to add for authentication:
Base Routes Path
To change the base routes path for for example in change the following line
License
Laravel Sanctum is open-sourced software licensed under the MIT license.