Service::hosts()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: chenyihong
5
 * Date: 16/8/1
6
 * Time: 15:06
7
 */
8
9
namespace Leo108\CAS\Models;
10
11
use Illuminate\Database\Eloquent\Model;
12
13
/**
14
 * Class Service
15
 * @package Leo108\CAS\Models
16
 *
17
 * @property string  $name
18
 * @property boolean $allow_proxy
19
 * @property boolean $enabled
20
 */
21
class Service extends Model
22
{
23
    protected $table = 'cas_services';
24
    protected $fillable = ['name', 'enabled', 'allow_proxy'];
25
    protected $casts = [
26
        'enabled'     => 'boolean',
27
        'allow_proxy' => 'boolean',
28
    ];
29
30
    public function hosts()
31
    {
32
        return $this->hasMany(ServiceHost::class);
33
    }
34
}
35