Passed
Pull Request — main (#69)
by
unknown
04:13 queued 44s
created

PostView   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A post() 0 3 1
1
<?php
2
3
namespace CSlant\Blog\Api\Models;
4
5
use CSlant\Blog\Core\Models\Post;
6
use Illuminate\Database\Eloquent\Model;
7
8
class PostView extends Model
9
{
10
    protected $table = 'post_views';
11
12
    protected $fillable = [
13
        'post_id',
14
        'ip_address',
15
        'time_check',
16
    ];
17
18
    protected $casts = [
19
        'time_check' => 'datetime',
20
    ];
21
22
    public function post()
23
    {
24
        return $this->belongsTo(Post::class, 'post_id');
25
    }
26
}
27