Add a second check here *just* to make sure someone doesn't break this.

This commit is contained in:
Dane Everitt 2017-03-04 19:27:24 -05:00
parent cd0a45a777
commit cbbd3704fe
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -113,6 +113,10 @@ class Server extends Model
*/
public static function byUuid($uuid)
{
if (! Auth::check()) {
throw new \Exception('You must call Server:byUuid as an authenticated user.');
}
// Results are cached because we call this functions a few times on page load.
$result = Cache::tags(['Model:Server', 'Model:Server:byUuid:' . $uuid])->remember('Model:Server:byUuid:' . $uuid . Auth::user()->uuid, Carbon::now()->addMinutes(15), function () use ($uuid) {
$query = self::with('service', 'node')->where(function ($q) use ($uuid) {