Completed
Push — master ( 9e9693...9e4b3d )
by Emad
02:46
created

Uuids   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 7 1
1
<?php
2
namespace Emadadly\LaravelUuid;
3
4
use Emadadly\LaravelUuid\UUIDManager;
5
6
trait Uuids
7
{
8
    /**
9
     * Boot function from laravel.
10
     */
11
    protected static function boot()
12
    {
13
        parent::boot();
14
        static::creating(function ($model) {
15
            $model->{$model->getKeyName()} = UUIDManager::generate();
16
        });
17
    }
18
}