Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
Activity_log
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 subject
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 causer
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getCreatedAtAttribute
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Models;
4
5use App\Traits\helper;
6use Illuminate\Database\Eloquent\Factories\HasFactory;
7use Illuminate\Database\Eloquent\Model;
8
9class Activity_log extends Model
10{
11    use HasFactory;
12    use helper;
13    protected $table = 'activity_log';
14
15    public $guarded = [];
16
17    protected $casts = [
18        'id'            => 'integer',
19        'properties'    => 'array',
20    ];
21
22    //relations
23    public function subject()
24    {
25        return $this->morphTo();
26    }
27
28    public function causer()
29    {
30        return $this->morphTo();
31    }
32
33    public function getCreatedAtAttribute(){
34        return $this->date_format($this->attributes['created_at']);
35    }
36}