31 lines
900 B
PHP
31 lines
900 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class SecurityQuestion extends BaseModel
|
|
{
|
|
use HasFactory;
|
|
protected $fillable=['questions'];
|
|
|
|
public function insertSecurityQuestion($inputData){
|
|
$result = [];
|
|
$security_question =self::whereRaw( 'UPPER(`questions`) LIKE ?', strtoupper($inputData['questions']) )->first();
|
|
if(empty($security_question)) {
|
|
$result = self::create($inputData);
|
|
}
|
|
return $result;
|
|
}
|
|
public function getSecurityQuestion(){
|
|
$security_question = [];
|
|
$security_question =self::paginate(config('constant.PAGINATION_LIMIT'));
|
|
return $security_question;
|
|
}
|
|
public function getSecurityQuestionById($id){
|
|
$security_question = [];
|
|
$security_question =self::where('id',$id)->first();
|
|
return $security_question;
|
|
}
|
|
}
|