This commit is contained in:
@@ -51,4 +51,19 @@ class Bot extends Model
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function logs()
|
||||
{
|
||||
return $this->hasMany(BotLog::class);
|
||||
}
|
||||
|
||||
public function latestLog()
|
||||
{
|
||||
return $this->hasOne(BotLog::class)->latestOfMany();
|
||||
}
|
||||
|
||||
public function failedLogs()
|
||||
{
|
||||
return $this->hasMany(BotLog::class)->where('status', 'failed');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user