(Update) Article+Comment Models

This commit is contained in:
HDVinnie
2018-04-22 17:41:39 -04:00
parent f29dfbd437
commit c643e5eb2e
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -31,7 +31,10 @@ class Article extends Model
*/
public function user()
{
return $this->belongsTo(\App\User::class);
return $this->belongsTo(\App\User::class)->withDefault([
'username' => 'System',
'id' => '1'
]);
}
/**
+4 -1
View File
@@ -51,7 +51,10 @@ class Comment extends Model
*/
public function user()
{
return $this->belongsTo(\App\User::class);
return $this->belongsTo(\App\User::class)->withDefault([
'username' => 'System',
'id' => '1'
]);
}
/**