PHP code example of bluecloud / laravel-security-question

1. Go to this page and download the library: Download bluecloud/laravel-security-question library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bluecloud / laravel-security-question example snippets


use Bluecloud\SecurityQuestionHelpers\HasSecurityQuestions;

class User extends Authenticatable
{
    use HasApiTokens, HasFactory, Notifiable, HasSecurityQuestions;
}

$user = auth()->user();
$user->save_questions([
    ["security_question_id" => 1, "answer" => "Blantyre, Malawi"]
]);

 $question = SecurityQuestion::find(1);
 $check = $user->check_answer($question, "Blantyre, Malawi");



return [
    "seeds": []
]

'strict' => true,

'middleware' => ["auth:sanctum"]

'path' => 'api/questions',

php artisan migrate
config/questions.php

php artisan vendor:publish

php artisan questions:migrate
config/questions.php
config/questions.php
config/questions.php
config/questions.php