本文整理匯總了PHP中Gateway::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gateway::all方法的具體用法?PHP Gateway::all怎麽用?PHP Gateway::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gateway
的用法示例。
在下文中一共展示了Gateway::all方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: generate_prefix
private function generate_prefix()
{
$prefix = explode(',', str_replace(" ", "", Config::get('settings.reserved_domain_prefix')));
foreach (Domain::all() as $domain) {
$prefix[] = $domain['prefix'];
}
foreach (Gateway::all() as $gateway) {
$prefix[] = $gateway['prefix'];
}
$rand_prefix = rand(1, 9) . rand(1, 9) . rand(1, 9);
if (in_array($rand_prefix, $prefix)) {
$this->generate_prefix();
} else {
return $rand_prefix;
}
}
示例2: postGatewaylist
public function postGatewaylist()
{
$token = Input::only('token');
$user_id = $this->_getUserId($token['token']);
$gateways = [];
$status = 0;
if ($user_id) {
$status = $this->_getUserStatus($user_id);
if ($status == 3) {
$gateways = Gateway::where('user_id', $user_id)->get();
$error = array(0, "");
} elseif ($status == 2) {
$gateways = Gateway::all();
$error = array(0, "");
}
} else {
$error = array(403, "Invalid Token");
}
return View::make('api.gateway')->with('gateways', $gateways)->with('error', $error)->with('status', $status);
}