Completed
Pull Request — master (#91)
by Glenn
02:47
created

Products   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 27
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A category() 0 4 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class Products
9
 * @package App
10
 */
11
class Products extends Model
12
{
13
    /**
14
     * Model table.
15
     *
16
     * @var string
17
     */
18
    protected $table = 'products';
19
20
    /**
21
     * Mass-assign fields
22
     *
23
     * @var array
24
     */
25
    protected $fillable = ['name', 'category_id'];
26
27
28
    /**
29
     * Product category relation.
30
     *
31
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
32
     */
33
    public function category()
34
    {
35
        return $this->belongsTo('App\ProductsCategories');
36
    }
37
}
38