Various code cleanup.

This commit is contained in:
James Cole
2021-07-10 07:29:39 +02:00
parent b0ccd26928
commit ddb222cc72
15 changed files with 52 additions and 89 deletions

View File

@@ -144,6 +144,19 @@ class Preferences
return $result;
}
/**
* @return Collection
*/
public function all(): Collection
{
$user = auth()->user();
if(null === $user) {
return new Collection;
}
return Preference::where('user_id', $user->id)->get();
}
/**
* @param User $user
* @param string $name