Passed
Push — master ( 6dc4e1...643de0 )
by Davide
31:15
created

Organizer::user()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace DavideCasiraghi\LaravelEventsCalendar\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Organizer extends Model
8
{
9
    /***************************************************************************/
10
    /**
11
     * The table associated with the model.
12
     *
13
     * @var string
14
     */
15
    protected $table = 'organizers';
16
17
    /***************************************************************************/
18
19
    protected $fillable = [
20
        'name', 'description', 'website', 'created_by', 'slug', 'email', 'phone',
21
    ];
22
    
23
    /***************************************************************************/
24
    
25
    /**
26
     * Get the user that owns the event. eg. $organizer->user
27
     */
28
    public function user()
29
    {
30
        return $this->belongsTo('\Illuminate\Foundation\Auth\User', 'created_by');
31
    }
32
}
33