Merge remote-tracking branch 'upstream/develop' into impl/results-per-page

This commit is contained in:
IsWaffle 2024-10-03 14:58:49 -04:00
commit 2b7b38808d
2 changed files with 13 additions and 0 deletions

View File

@ -108,6 +108,11 @@ class Mod extends Model
*/
public function toSearchableArray(): array
{
$this->load([
'latestVersion',
'latestVersion.latestSptVersion',
]);
return [
'id' => $this->id,
'name' => $this->name,
@ -138,6 +143,12 @@ class Mod extends Model
return false;
}
// Eager load the latest mod version, and it's latest SPT version.
$this->load([
'latestVersion',
'latestVersion.latestSptVersion',
]);
// Ensure the mod has a latest version.
if ($this->latestVersion()->doesntExist()) {
return false;

View File

@ -137,6 +137,8 @@ class User extends Authenticatable implements MustVerifyEmail
*/
public function shouldBeSearchable(): bool
{
$this->load(['bans']);
return $this->isNotBanned();
}