Developer::toSearchableArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
/*
4
 * rmarchiv.tk
5
 * (c) 2016-2017 by Marcel 'ryg' Hering
6
 */
7
8
namespace App\Models;
9
10
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
11
use Laravel\Scout\Searchable;
12
use Illuminate\Database\Eloquent\Model;
13
14
/**
15
 * Class Developer.
16
 *
17
 * @property int $id
18
 * @property string $name
19
 * @property string $short
20
 * @property string $website_url
21
 * @property int $user_id
22
 * @property string $deleted_at
23
 * @property \Carbon\Carbon $created_at
24
 * @property \Carbon\Carbon $updated_at
25
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Developer whereId($value)
26
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Developer whereName($value)
27
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Developer whereShort($value)
28
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Developer whereWebsiteUrl($value)
29
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Developer whereUserId($value)
30
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Developer whereDeletedAt($value)
31
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Developer whereCreatedAt($value)
32
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Developer whereUpdatedAt($value)
33
 * @mixin \Eloquent
34
 * @property-read \App\Models\User $user
35
 * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory
36
 */
37
class Developer extends Model
38
{
39
    use \Venturecraft\Revisionable\RevisionableTrait;
40
    use Searchable;
41
42
    protected $table = 'developer';
43
44
    public $timestamps = true;
45
46
    protected $fillable = [
47
        'name',
48
        'short',
49
        'website_url',
50
        'user_id',
51
    ];
52
53
    protected $guarded = [];
54
55
    public function user()
56
    {
57
        return $this->hasOne('App\Models\User', 'id', 'user_id');
58
    }
59
60
    /**
61
     * Get the indexable data array for the model.
62
     *
63
     * @return array
64
     */
65
    public function toSearchableArray()
66
    {
67
        return [
68
            'id'   => $this->id,
69
            'name' => $this->name,
70
        ];
71
    }
72
}
73