<?php namespace App\Models; use App\Helpers\Constants; use Illuminate\Database\Eloquent\Model; class Track extends Model { protected $table = Constants::TABLE_TRACKS;
public $timestamps = false;
/** * Hàm lấy ds nghệ sĩ biểu diễn 1 bài hát * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function artists() { return $this->belongsToMany( 'App\Models\Artist', Constants::TABLE_ARTISTS, 'track_id', 'artist_id' ); } }