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


PHP Locale::where方法代码示例

本文整理汇总了PHP中Locale::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Locale::where方法的具体用法?PHP Locale::where怎么用?PHP Locale::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Locale的用法示例。


在下文中一共展示了Locale::where方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     // Check if an admin user exists.
     $admin = User::where('username', 'admin')->first();
     if (count($admin) && $this->confirm('Admin user already exists, delete? [yes|no]')) {
         try {
             User::find($admin->id)->delete();
         } catch (Exception $e) {
             $this->error($e);
             return;
         }
         $this->info('Admin user deleted!');
     }
     // Create admin user.
     try {
         $admin = new User();
         $admin->username = 'admin';
         $admin->password = Hash::make($this->secret('Password: '));
         $admin->email = $this->ask('Email: ');
         $admin->first_name = 'System';
         $admin->last_name = 'Admin';
         $admin->locale_id = Locale::where('locale', 'en')->first()->id;
         $admin->status = 'active';
         $admin->role = 'admin';
         $admin->save();
     } catch (Exception $e) {
         $this->error($e);
         return;
     }
     $this->info('Admin user created');
 }
开发者ID:vipervoid,项目名称:Pitimi,代码行数:36,代码来源:AdminCreateCommand.php

示例2: editProfil

 public function editProfil()
 {
     //data
     $data['user'] = Auth::user();
     //Interface
     $data['noAriane'] = true;
     $data['glyphicon'] = 'ok';
     $data['buttonLabel'] = Lang::get('button.update');
     //langsBackend
     $data['langsBackend'] = Locale::where('on_admin', '=', 1)->orderBy('enable', 'DESC')->orderBy('id')->get();
     return View::make('theme::' . 'admin.auth.edit_profil', $data);
 }
开发者ID:Metrakit,项目名称:dynamix,代码行数:12,代码来源:AdminAuthController.php

示例3: index

 /**
  *Diisplay list of resources
  *
  * @return Response
  */
 public function index()
 {
     //User
     $data['user'] = Auth::user();
     //Interface
     $data['noAriane'] = true;
     //Construction d'un tableau de
     $data['langsFrontEnd'] = Locale::where('enable', '=', 1)->orderBy('enable', 'DESC')->orderBy('id')->get();
     if (Request::ajax()) {
         return Response::json(View::make('theme::' . 'admin.tag.index', $data)->renderSections());
     } else {
         return View::make('theme::' . 'admin.tag.index', $data);
     }
 }
开发者ID:Metrakit,项目名称:dynamix,代码行数:19,代码来源:AdminTagController.php

示例4: initCache

    public function initCache()
    {
        // !!! DATABASE CACHE !!!
        //Cache Model::Menu
        //Cache::forget('DB_Menu');
        /*Cache::rememberForever('DB_Menu', function()
        		{
        		    return Menu::where('parent_id','=',0)->orderBy('order','ASC')->get();
        		});*/
        //Cache Model::Locale
        Cache::rememberForever('DB_LocaleFrontEnable', function () {
            //Get all data in database
            $locales = Locale::where('enable', '=', 1)->where('is_publish', '=', 1)->get();
            //Preapre data to extract by id
            $data = array();
            foreach ($locales as $l) {
                $data[] = $l->id;
            }
            return $data;
        });
        //Cache Model::Nav
        Cache::rememberForever('DB_Nav', function () {
            return Nav::where('parent_id', '=', 0)->orderBy('order', 'ASC')->get();
        });
        //Cache Model::Resource('name')
        Cache::rememberForever('DB_AdminResourceName', function () {
            //Get all data in database
            $resources = Resource::where('in_admin_ui', '=', 1)->get();
            //Preapre data to extract by id
            $data = array();
            foreach ($resources as $r) {
                $data[$r->id] = $r->name;
            }
            return $data;
        });
        Cache::rememberForever('DB_AdminResource', function () {
            //Get all data in database
            return Resource::where('in_admin_ui', '=', 1)->get();
        });
        Cache::rememberForever('DB_AdminResourceNavigable', function () {
            //Get all data in database
            return Resource::where('navigable', '=', 1)->where('in_admin_ui', '=', 1)->get();
        });
        // Get all Locales enableds in the table
        Cache::rememberForever('DB_LocalesEnabled', function () {
            return Locale::where('enable', 1)->where('is_publish', 1)->get();
        });
        Cache::rememberForever('DB_AdminBlockTypes', function () {
            //Get all data in database
            return BlockType::all();
        });
        //Cache Model::Mosaique('name')
        //Cache::forget('DB_Mosaique');
        /*Cache::rememberForever('DB_Mosaique', function()
        		{
        			//Get all data in database
        		    return Mosaique::all();
        		});*/
        //Cache Model::Option
        Cache::rememberForever('DB_Option', function () {
            return Option::all();
        });
        //Cache Model::Urls
        Cache::rememberForever('DB_Urls', function () {
            $data = DB::select('
		    	SELECT translations.i18n_id , translations.text , translations.locale_id 
				FROM translations
				INNER JOIN i18n_types ON i18n_types.name = ?
				INNER JOIN i18n ON i18n.i18n_type_id = i18n_types.id AND translations.i18n_id = i18n.id
		    ', array('url'));
            //$data = Translation::i18n()->where('i18n_type_id','=',I18nType::where('name','=','url')->first()->id)->get
            $datas = array();
            foreach ($data as $d) {
                $datas[] = array('i18n_id' => $d->i18n_id, 'url' => $d->text, 'locale_id' => $d->locale_id);
            }
            return $datas;
        });
    }
开发者ID:Metrakit,项目名称:dynamix,代码行数:78,代码来源:Cachr.php


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