mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-26 06:57:58 +01:00
Remove unnecessary table name property
By convention, Laravel uses the "snake case", plural name of the class as the table name.
This commit is contained in:
parent
9374905d7b
commit
3b2d58b77f
17 changed files with 0 additions and 24 deletions
|
@ -126,8 +126,6 @@ class Album extends Model implements Searchable, Commentable, Favouritable
|
|||
return $query;
|
||||
}
|
||||
|
||||
protected $table = 'albums';
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
|
|
|
@ -49,7 +49,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class Announcement extends Model
|
||||
{
|
||||
protected $table = 'announcements';
|
||||
|
||||
protected $casts = [
|
||||
'links' => 'array',
|
||||
|
|
|
@ -70,8 +70,6 @@ class Comment extends Model
|
|||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'comments';
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
|
|
|
@ -47,7 +47,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class Favourite extends Model
|
||||
{
|
||||
protected $table = 'favourites';
|
||||
public $timestamps = false;
|
||||
|
||||
/*
|
||||
|
|
|
@ -42,7 +42,6 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|||
*/
|
||||
class Follower extends Model
|
||||
{
|
||||
protected $table = 'followers';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
|
|
|
@ -60,8 +60,6 @@ class Genre extends Model
|
|||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'genres';
|
||||
|
||||
protected $fillable = ['name', 'slug'];
|
||||
protected $appends = ['track_count', 'url'];
|
||||
protected $hidden = ['trackCountRelation'];
|
||||
|
|
|
@ -165,8 +165,6 @@ class Image extends Model
|
|||
chmod($path, 0644);
|
||||
}
|
||||
|
||||
protected $table = 'images';
|
||||
|
||||
public function getUrl($type = self::NORMAL)
|
||||
{
|
||||
$type = self::$ImageTypes[$type];
|
||||
|
|
|
@ -41,5 +41,4 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class License extends Model
|
||||
{
|
||||
protected $table = 'licenses';
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class PinnedPlaylist extends Model
|
||||
{
|
||||
protected $table = 'pinned_playlists';
|
||||
|
||||
public function user()
|
||||
{
|
||||
|
|
|
@ -94,8 +94,6 @@ class Playlist extends Model implements Searchable, Commentable, Favouritable
|
|||
|
||||
protected $elasticsearchType = 'playlist';
|
||||
|
||||
protected $table = 'playlists';
|
||||
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'user_id' => 'integer',
|
||||
|
|
|
@ -51,7 +51,6 @@ use Illuminate\Support\Facades\Request;
|
|||
*/
|
||||
class ResourceLogItem extends Model
|
||||
{
|
||||
protected $table = 'resource_log_items';
|
||||
public $timestamps = false;
|
||||
protected $dates = ['created_at'];
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class ResourceUser extends Model
|
||||
{
|
||||
protected $table = 'resource_users';
|
||||
public $timestamps = false;
|
||||
|
||||
public static function get($userId, $resourceType, $resourceId)
|
||||
|
|
|
@ -34,7 +34,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class Role extends Model
|
||||
{
|
||||
protected $table = 'roles';
|
||||
public $timestamps = false;
|
||||
|
||||
public function users()
|
||||
|
|
|
@ -46,7 +46,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class ShowSong extends Model
|
||||
{
|
||||
protected $table = 'show_songs';
|
||||
protected $fillable = ['title', 'slug', 'lyrics'];
|
||||
|
||||
public function trackCountRelation()
|
||||
|
|
|
@ -692,8 +692,6 @@ class Track extends Model implements Searchable, Commentable, Favouritable
|
|||
];
|
||||
}
|
||||
|
||||
protected $table = 'tracks';
|
||||
|
||||
public function genre()
|
||||
{
|
||||
return $this->belongsTo(Genre::class);
|
||||
|
|
|
@ -35,7 +35,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class TrackType extends Model
|
||||
{
|
||||
protected $table = 'track_types';
|
||||
|
||||
const ORIGINAL_TRACK = 1;
|
||||
const OFFICIAL_TRACK_REMIX = 2;
|
||||
|
|
|
@ -109,8 +109,6 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
use Authenticatable, CanResetPassword, Authorizable, RevisionableTrait, IndexedInElasticsearchTrait;
|
||||
|
||||
protected $elasticsearchType = 'user';
|
||||
|
||||
protected $table = 'users';
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'sync_names' => 'boolean',
|
||||
|
|
Loading…
Reference in a new issue