| 1 | <?php |
||
| 21 | class Login extends Model |
||
| 22 | { |
||
| 23 | /** @var string */ |
||
| 24 | const TYPE_LOGIN = 'auth'; |
||
| 25 | const TYPE_FAILED = 'failed'; |
||
| 26 | const TYPE_LOCKOUT = 'lockout'; |
||
| 27 | /** @var array $with */ |
||
| 28 | protected $with = ['device']; |
||
| 29 | /** @var array $casts */ |
||
| 30 | protected $casts = [ |
||
| 31 | 'user_id' => 'integer', |
||
| 32 | 'user_type' => 'string', |
||
| 33 | 'device_id' => 'integer', |
||
| 34 | 'ip_address' => 'string', |
||
| 35 | ]; |
||
| 36 | /** @var array $fillable */ |
||
| 37 | protected $fillable = [ |
||
| 38 | 'user_id', |
||
| 39 | 'user_type', |
||
| 40 | 'ip_address', |
||
| 41 | 'created_at', |
||
| 42 | 'type', |
||
| 43 | ]; |
||
| 44 | |||
| 45 | public function user(): MorphTo |
||
| 49 | |||
| 50 | public function device(): BelongsTo |
||
| 56 | } |
||
| 57 |