ApiKeys::getUserName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * @Author: ahmadnorin
5
 * @Date:   2017-11-28 00:17:29
6
 * @Last Modified by:   ahmadnorin
7
 * @Last Modified time: 2017-11-28 09:44:35
8
 */
9
10
namespace App;
11
12
use Illuminate\Notifications\Notifiable;
13
use Illuminate\Database\Eloquent\SoftDeletes;
14
use Illuminate\Database\Eloquent\Model;
15
16
class ApiKeys extends Model
17
{
18
    use Notifiable;
19
    use SoftDeletes;
20
    protected $table = "api_keys";
21
    protected $dates = ['deleted_at'];
22
    protected $fillable = [
23
        'client', 'api_key', 'created_at', 'updated_at'
24
    ];
25
26
    public $hidden = ['created_at', 'updated_at'];
27
28
    public function getUserName()
29
    {
30
        return $this->belongsTo('App\User','user_id','id');
31
    }
32
}
33