updated models

This commit is contained in:
2018-07-14 12:24:24 +02:00
parent c75b25b89b
commit 6fd1d7eb89
16 changed files with 225 additions and 129 deletions
+6 -12
View File
@@ -34,7 +34,7 @@ class User extends Authenticatable
/** Owned tables */
public function dataTables()
{
return $this->hasMany(DataTable::class, 'owner_id');
return $this->hasMany(Table::class, 'owner_id');
}
/** Assigned OAuth identities */
@@ -43,10 +43,10 @@ class User extends Authenticatable
return $this->hasMany(OAuthIdentity::class);
}
/** Assigned OAuth identities */
public function changesets()
/** Authored proposals */
public function proposals()
{
return $this->hasMany(Changeset::class, 'author_id');
return $this->hasMany(Proposal::class, 'author_id');
}
/** Authored comments */
@@ -58,13 +58,13 @@ class User extends Authenticatable
/** User's favourite tables (personal collection) */
public function favouriteTables()
{
return $this->belongsToMany(DataTable::class, 'table_favourites');
return $this->belongsToMany(Table::class, 'table_favourites');
}
/** Tables whose discussions user follows (this is similar to favourites) */
public function followedDiscussions()
{
return $this->belongsToMany(DataTable::class, 'discussion_follows');
return $this->belongsToMany(Table::class, 'discussion_follows');
}
/** Reports sent by this user */
@@ -73,12 +73,6 @@ class User extends Authenticatable
return $this->hasMany(ContentReport::class, 'author_id');
}
/** Reports of this user */
public function reportsOf()
{
return $this->morphMany(ContentReport::class, 'object');
}
/** Notifications for this user */
public function notifications()
{