inital commit
This commit is contained in:
30
app/Models/SecurityQuestion.php
Normal file
30
app/Models/SecurityQuestion.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user