AuthenticationLog   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 39
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A authenticatable() 0 3 1
1
<?php
2
3
namespace Yadahan\AuthenticationLog;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class AuthenticationLog extends Model
8
{
9
    /**
10
     * The table associated with the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'authentication_log';
15
16
    /**
17
     * Indicates if the model should be timestamped.
18
     *
19
     * @var bool
20
     */
21
    public $timestamps = false;
22
23
    /**
24
     * The attributes that aren't mass assignable.
25
     *
26
     * @var array
27
     */
28
    protected $guarded = ['authenticatable_id', 'authenticatable_type'];
29
30
    /**
31
     * The attributes that should be cast to native types.
32
     *
33
     * @var array
34
     */
35
    protected $casts = [
36
        'login_at' => 'datetime',
37
        'logout_at' => 'datetime',
38
    ];
39
40
    /**
41
     * Get the authenticatable entity that the authentication log belongs to.
42
     */
43
    public function authenticatable()
44
    {
45
        return $this->morphTo();
46
    }
47
}
48