当前位置: 首页>>代码示例>>PHP>>正文


PHP Domain::all方法代码示例

本文整理汇总了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');
开发者ID:digideskio,项目名称:voip-id,代码行数:31,代码来源:routes.php

示例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;
     }
 }
开发者ID:digideskio,项目名称:voip-id,代码行数:16,代码来源:DomainController.php

示例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);
 }
开发者ID:digideskio,项目名称:voip-id,代码行数:29,代码来源:CallDetailReportsController.php


注:本文中的Domain::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。