/** * setKey * * @param mixed $app_id * @param string $key * * @return Hook\Model\AppKey */ public static function validateKey($app_id, $key) { $app_key = AppKey::with('app')->where('app_id', $app_id)->where('key', $key)->first(); if ($app_key) { return static::setKey($app_key); } }