本文整理汇总了PHP中Domain::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Domain::all方法的具体用法?PHP Domain::all怎么用?PHP Domain::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
if (App::runningInConsole()) {
return;
}
// WARNING: you must comment this init route on production
// INIT INIT INIT COMMENT THIS AFTER FIRST USAGE
Route::controller('init', 'InitController');
//route by domain
foreach (Domain::all() as $dcp) {
Route::group(array('domain' => $dcp['domain']), function () use($dcp) {
if (!Cookie::get('domain_hash')) {
Route::get('/', 'PanelController@dcp');
}
});
}
Route::get('/', 'HomeController@showHome');
Route::controller('login', 'LoginController');
Route::get('logout', 'LoginController@getLogout');
Route::controller('register', 'RegisterController');
Route::controller('password', 'PasswordController');
// Start of private routes protected with auth
Route::controller('dashboard', 'DashboardController');
Route::get('phone_number/manage/{hash}', 'PhoneNumberController@manage');
Route::get('phone_number/manage/{hash}/add', 'PhoneNumberController@getAdd');
Route::get('phone_number/manage/{hash}/edit/{id}', 'PhoneNumberController@getEdit');
Route::post('phone_number/manage/{hash}/store', 'PhoneNumberController@postStore');
Route::any('phone_number/manage/{hash}/update/{id}', 'PhoneNumberController@update');
Route::get('phone_number/manage/{hash}/delete/{id}', 'PhoneNumberController@getDelete');
Route::any('phone_number/update/{id}', 'PhoneNumberController@update');
Route::any('phone_number/search', 'PhoneNumberController@getIndex');
示例2: 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;
}
}
示例3: getFilterori
public function getFilterori()
{
if (Request::segment(2) == 'filter') {
$input = Session::get('search') && !Input::get('search_category') ? Session::get('search') : Input::only(array('search_category', 'search_keyword'));
switch ($input['search_category']) {
case '0':
return Redirect::to('domain');
break;
case 'owner':
$domains = Domain::whereHas('user', function ($q) {
$q->where('username', 'LIKE', '%' . Input::get('search_keyword') . '%');
})->get();
break;
default:
if (Auth::user()->status == 2) {
$domains = Domain::where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
} else {
$domains = Domain::where('user_id', Auth::user()->id)->where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
}
break;
}
Session::set('search', $input);
} else {
Session::remove('search');
$input = array('search_category' => '', 'search_keyword' => '');
$domains = Auth::user()->status == 2 ? Domain::all() : Domain::where('user_id', Auth::user()->id)->get();
}
return View::make('domain.index')->with('domains', $domains)->with('selected', $input);
}