本文整理匯總了PHP中Key::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Key::all方法的具體用法?PHP Key::all怎麽用?PHP Key::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Key
的用法示例。
在下文中一共展示了Key::all方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
parent::__construct();
/* This checks the client list for the CID. If a matching CID is found, all caching will be ignored
for this request */
if (Cache::has('clients')) {
$clients = Cache::get('clients');
} else {
$clients = Client::all();
Cache::put('clients', $clients, 1);
}
if (Cache::has('keys')) {
$keys = Cache::get('keys');
} else {
$keys = Key::all();
Cache::put('keys', $keys, 1);
}
$input_cid = Input::get('cid');
if (!empty($input_cid)) {
foreach ($clients as $client) {
if ($client->uuid == $input_cid) {
$this->client = $client;
}
}
}
$input_key = Input::get('k');
if (!empty($input_key)) {
foreach ($keys as $key) {
if ($key->api_key == $input_key) {
$this->key = $key;
}
}
}
}
示例2: getList
public function getList()
{
$keys = Key::all();
return View::make('key.list')->with('keys', $keys);
}