| Code Coverage
| Classes and Traits | Functions and Methods | Lines
Total | 0.00% covered (danger) | 0.00% | 0 / 1 | 0.00% covered (danger) | 0.00% | 0 / 1 | CRAP | 0.00% covered (danger) | 0.00% | 0 / 5
Log | 0.00% covered (danger) | 0.00% | 0 / 1 | 0.00% covered (danger) | 0.00% | 0 / 1 | 6.00 | 0.00% covered (danger) | 0.00% | 0 / 5
getUserNameAttribute | 0.00% covered (danger) | 0.00% | 0 / 1 | 6.00 | 0.00% covered (danger) | 0.00% | 0 / 5

1 | <?php
2 |
3 | namespace App;
4 |
5 | use Illuminate\Database\Eloquent\Model;
6 |
7 | class Log extends Model
8 | {
9 | protected $fillable = [
10 | 'operation', 'description','type', 'operator', 'ip','id_user',
11 | ];
12 | public function getUserNameAttribute(){
13 | $idUser=$this['id_user'];
14 | if($idUser){
15 | $user=User::find($idUser);
16 | return $user['name'];
17 | }
18 | return '';
19 | }
20 | }