mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-07 03:58:52 -06:00
95 lines
1.9 KiB
PHP
95 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
|
|
* The details is bundled with this project in the file LICENSE.txt.
|
|
*
|
|
* @project UNIT3D
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
|
|
* @author HDVinnie
|
|
*/
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class TwoStepAuth extends Model
|
|
{
|
|
/**
|
|
* The table associated with the model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = 'twostep_auth';
|
|
|
|
/**
|
|
* Indicates if the model should be timestamped.
|
|
*
|
|
* @var bool
|
|
*/
|
|
public $timestamps = true;
|
|
|
|
/**
|
|
* The attributes that are not mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $guarded = [
|
|
'id',
|
|
];
|
|
|
|
/**
|
|
* The attributes that should be mutated to dates.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $dates = [
|
|
'created_at',
|
|
'updated_at',
|
|
'requestDate',
|
|
'authDate',
|
|
];
|
|
|
|
/**
|
|
* Fillable fields for a Profile.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'userId',
|
|
'authCode',
|
|
'authCount',
|
|
'authStatus',
|
|
'requestDate',
|
|
'authDate',
|
|
];
|
|
|
|
protected $casts = [
|
|
'userId' => 'integer',
|
|
'authCode' => 'string',
|
|
'authCount' => 'integer',
|
|
'authStatus' => 'boolean',
|
|
];
|
|
|
|
/**
|
|
* Get a validator for an incoming Request.
|
|
*
|
|
* @param array $merge (rules to optionally merge)
|
|
*
|
|
* @return array
|
|
*/
|
|
public static function rules($merge = [])
|
|
{
|
|
return array_merge(
|
|
[
|
|
'userId' => 'required|integer',
|
|
'authCode' => 'required|string|max:4|min:4',
|
|
'authCount' => 'required|integer',
|
|
'authStatus' => 'required|boolean'
|
|
],
|
|
$merge
|
|
);
|
|
}
|
|
}
|