User_nationality   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 5 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Webpatser\Uuid\Uuid;
7
8
class User_nationality extends Base_Model  {
9
10
    /**
11
     * The database table used by the model.
12
     *
13
     * @var string
14
     */
15
    protected $table = 'user_nationalities';
16
17
    /**
18
     * Attributes that should be mass-assignable.
19
     *
20
     * @var array
21
     */
22
    protected $fillable = ['nationality_id', 'security_user_id', 'comments', 'preferred', 'modified_user_id', 'modified', 'created_user_id', 'created'];
23
24
    /**
25
     * The attributes excluded from the model's JSON form.
26
     *
27
     * @var array
28
     */
29
    protected $hidden = [];
30
31
    /**
32
     * The attributes that should be casted to native types.
33
     *
34
     * @var array
35
     */
36
    protected $casts = [];
37
38
    /**
39
     * The attributes that should be mutated to dates.
40
     *
41
     * @var array
42
     */
43
    protected $dates = ['modified', 'created'];
44
    
45
    
46
    
47
    public static function boot()
48
    {
49
        parent::boot();
50
        self::creating(function ($model) {
51
            $model->id = (string) Uuid::generate(4);
52
        });
53
54
    }
55
56
}