*/ protected $fillable = [ 'user_id', 'city', 'country', 'short_description', 'price_per_hour', 'instagram_link', 'soundcloud_link', 'apple_music_link', 'youtube_link', 'spotify_link', 'manager_id', 'artist_type_id', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'admin_verified_at' => 'datetime', 'birth_date' => 'date', ]; public function isOnboardingCompleted() { return !((is_null($this->birth_date) || trim($this->birth_date) === '') || (is_null($this->city) || trim($this->city) === '') || (is_null($this->country) || trim($this->country) === '') || (is_null($this->short_description) || trim($this->short_description) === '') || (self::artist_type()->doesntExist()) || (self::genres()->doesntExist())); } public function user(): BelongsTo { return $this->belongsTo(User::class); } public function artist_type(): BelongsTo { return $this->belongsTo(ArtistType::class); } public function manager(): BelongsTo { return $this->belongsTo(Manager::class, 'manager_id', 'user_id'); } public function images(): HasMany { return $this->hasMany(ArtistImage::class, 'artist_id'); } public function genres(): BelongsToMany { return $this->belongsToMany(Genre::class, 'artist_sings_genres', 'artist_id'); } public function manager_invites(): HasOne { return $this->hasOne(ManagerInvite::class, 'user_id', 'artist_id'); } public function offers(): HasMany { return $this->hasMany(Offer::class, 'artist_id'); } public function reviews(): HasMany { return $this->hasMany(Review::class, 'artist_id'); } }