1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Models; |
4
|
|
|
|
5
|
|
|
use Illuminate\Database\Eloquent\Model; |
6
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo; |
7
|
|
|
use Laravel\Scout\Searchable; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* App\Models\MusicInfo. |
11
|
|
|
* |
12
|
|
|
* @property int $id |
13
|
|
|
* @property string $title |
14
|
|
|
* @property string|null $asin |
15
|
|
|
* @property string|null $url |
16
|
|
|
* @property int|null $salesrank |
17
|
|
|
* @property string|null $artist |
18
|
|
|
* @property string|null $publisher |
19
|
|
|
* @property string|null $releasedate |
20
|
|
|
* @property string|null $review |
21
|
|
|
* @property string $year |
22
|
|
|
* @property int|null $genres_id |
23
|
|
|
* @property string|null $tracks |
24
|
|
|
* @property bool $cover |
25
|
|
|
* @property \Carbon\Carbon|null $created_at |
26
|
|
|
* @property \Carbon\Carbon|null $updated_at |
27
|
|
|
* @property-read Genre|null $genre |
28
|
|
|
* |
29
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereArtist($value) |
30
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereAsin($value) |
31
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereCover($value) |
32
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereCreatedAt($value) |
33
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereGenresId($value) |
34
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereId($value) |
35
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo wherePublisher($value) |
36
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereReleasedate($value) |
37
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereReview($value) |
38
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereSalesrank($value) |
39
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereTitle($value) |
40
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereTracks($value) |
41
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereUpdatedAt($value) |
42
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereUrl($value) |
43
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo whereYear($value) |
44
|
|
|
* |
45
|
|
|
* @mixin \Eloquent |
46
|
|
|
* |
47
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo newModelQuery() |
48
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo newQuery() |
49
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MusicInfo query() |
50
|
|
|
*/ |
51
|
|
|
class MusicInfo extends Model |
52
|
|
|
{ |
53
|
|
|
use Searchable; |
|
|
|
|
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var string |
57
|
|
|
*/ |
58
|
|
|
protected $table = 'musicinfo'; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @var bool |
62
|
|
|
*/ |
63
|
|
|
protected $dateFormat = false; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @var bool |
67
|
|
|
*/ |
68
|
|
|
public $timestamps = true; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @var array |
72
|
|
|
*/ |
73
|
|
|
protected $guarded = []; |
74
|
|
|
|
75
|
|
|
public function genre(): BelongsTo |
76
|
|
|
{ |
77
|
|
|
return $this->belongsTo(Genre::class, 'genres_id'); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
public function searchableAs(): string |
81
|
|
|
{ |
82
|
|
|
return 'ix_musicinfo_artist_title_ft'; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
public function toSearchableArray(): array |
86
|
|
|
{ |
87
|
|
|
return [ |
88
|
|
|
'artist' => $this->artist, |
89
|
|
|
'title' => $this->title, |
90
|
|
|
]; |
91
|
|
|
} |
92
|
|
|
} |
93
|
|
|
|