Blog::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
namespace Bantenprov\VueBlog\Models;
3
4
use Illuminate\Notifications\Notifiable;
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
/**
9
 * Define POst model.
10
 */
11
class Blog extends Model
12
{
13
    use Notifiable;
14
    use SoftDeletes;
15
16
    protected $table = "blog";
17
    protected $dates = ['deleted_at'];
18
    protected $fillable = [
19
      'title',
20
      'content',
21
      'excerpt',
22
      'slug',
23
      'user_id',
24
    ];
25
26
   protected $hidden = [
27
       'deleted_at'
28
   ];
29
30
    function __construct()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
31
    {
32
        // var_dump($this->fillable);
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
33
    }
34
35
    /**
36
     * A Post belongs to a single User.
37
     *
38
     */
39
    public function user()
40
    {
41
        return $this->belongsTo('App\User');
42
    }
43
}
44