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


PHP Blueprint::enum方法代码示例

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


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

示例1: _schema_LoginableTrait

 /**
  * @param Blueprint $table
  * @return Blueprint
  */
 public static function _schema_LoginableTrait(Blueprint $table)
 {
     $table->string('password')->nullable();
     $table->rememberToken('remember_token');
     $table->dateTime('last_login')->nullable();
     $table->string('last_ip')->nullable();
     $table->integer('fails')->default(0);
     $table->enum('is_banned', [0, 1])->default(0);
     $table->text('ban_reason')->nullable();
     $table->enum('locked_screen', [0, 1])->default(0);
     return $table;
 }
开发者ID:xjtuwangke,项目名称:laravel-bundles,代码行数:16,代码来源:LoginableTrait.php

示例2: activate

 /**
  * Activates the table.
  *
  * @param \Illuminate\Database\Schema\Blueprint $table
  */
 public function activate(Blueprint $table)
 {
     $table->increments('id');
     $table->string('title');
     $table->string('slug');
     $table->enum('type', ['PROFILE', 'SHARE'])->default('PROFILE');
 }
开发者ID:PrafullaKumarSahu,项目名称:wordpress-socializr,代码行数:12,代码来源:SetsTable.php

示例3: documentSchema

 /**
  * @param Blueprint $table table
  * @return Blueprint
  */
 private function documentSchema(Blueprint $table)
 {
     $table->string('parentId', 255)->default('');
     $table->string('instanceId', 255)->default('');
     // users
     $table->string('userType', '16')->default('normal');
     $table->string('userId', 255);
     $table->string('writer', 255);
     $table->string('email')->nullable();
     // 비회원 작성일때 email 받기?
     $table->string('certifyKey', 255);
     // nonmember document's password
     // count
     $table->integer('readCount')->default(0);
     $table->integer('commentCount')->default(0);
     $table->integer('assentCount')->default(0);
     $table->integer('dissentCount')->default(0);
     // display contents config values
     $table->enum('approved', array('approved', 'waiting', 'rejected'))->default('approved');
     $table->enum('published', array('published', 'waiting', 'reserved', 'rejected'))->default('published');
     // temp 대신 draft가 어떨까?
     $table->enum('status', array('public', 'temp', 'trash', 'private', 'notice'))->default('public');
     $table->enum('display', array('visible', 'secret', 'hidden'))->default('visible');
     // search
     $table->string('locale', 255)->default('');
     // multi-language support. ko, en, jp, ...
     $table->string('title', 255);
     $table->text('content');
     $table->text('pureContent');
     $table->timestamp('createdAt');
     $table->timestamp('publishedAt');
     $table->timestamp('updatedAt');
     $table->timestamp('deletedAt')->nullable();
     // 대댓글 처리를 위한 트리용 컬럼 추가 ex.) head, parent, depth
     $table->string('head', 50);
     // timestamp + uuid (ex. 1430369257-bd1fc797-474f-47a6-bedb-867a376490f2)
     $table->string('reply', 200)->nullable();
     $table->string('listOrder', 250);
     $table->string('ipaddress', 16);
     $table->index('createdAt');
     $table->unique(['head', 'reply']);
     return $table;
 }
开发者ID:mint-soft-com,项目名称:xpressengine,代码行数:47,代码来源:DocumentMigration.php

示例4: _schema_UserModel

 public static function _schema_UserModel(Blueprint $table)
 {
     $table->string('email')->nullable()->label('邮箱');
     $table->string('mobile')->nullable()->label('手机号码');
     $table->string('username')->nullable()->label('姓名');
     $table->string('nickname')->nullable()->label('昵称');
     $table->enum('gender', ['未填' => '未填', '男' => '男', '女' => '女'])->default('未填')->label('性别');
     $table->string('avatar')->nullable()->label('头像');
     $table->date('birthday')->nullable()->label('生日');
     return $table;
 }
开发者ID:xjtuwangke,项目名称:laravel-bundles,代码行数:11,代码来源:UserModelBase.php

示例5: _schema_chinaArea

 /**
  * @param Blueprint $table
  * @return Blueprint
  */
 public static function _schema_chinaArea(Blueprint $table)
 {
     $table->integer('areano');
     $table->integer('parentno');
     $table->string('name');
     $table->string('province')->nullable();
     $table->string('city')->nuallable();
     $table->string('distinct')->nullable();
     $table->enum('flag', ['国家', '省', '市', '区/县']);
     $table->integer('sort')->default(99);
     $table->integer('zipcode')->default(0);
     return $table;
 }
开发者ID:xjtuwangke,项目名称:laravel-bundles,代码行数:17,代码来源:China.php

示例6: _schema_multiStatusTrait

 public static function _schema_multiStatusTrait(\Illuminate\Database\Schema\Blueprint $table)
 {
     $status = static::$AllowedStatus;
     $default = $status[0];
     $table->enum('status', $status)->default($default);
     if (isset(static::$StatusDateTime)) {
         foreach (static::$StatusDateTime as $column) {
             if (!in_array($column, ['created_at', 'updated_at', 'deleted_at'])) {
                 $table->dateTime($column)->nullable();
             }
         }
     }
     $table->index(['status']);
     return $table;
 }
开发者ID:xjtuwangke,项目名称:laravel-models,代码行数:15,代码来源:MultiStatusTrait.php

示例7: _schema_usermodel

 public static function _schema_usermodel(\Illuminate\Database\Schema\Blueprint $table)
 {
     $table->string('username', 100);
     $table->string('nickname', 30)->unique();
     $table->string('email', 100);
     $table->string('mobile', 20);
     $table->integer('exp')->default(0);
     $table->integer('points')->default(0);
     $table->date('birthdate')->nullable();
     $table->enum('gender', ['男', '女', '保密'])->default('保密');
     $table->string('password', 100);
     $table->string('remember_token', 100);
     $table->timestamp('last_login');
     return $table;
 }
开发者ID:xjtuwangke,项目名称:laravel-models,代码行数:15,代码来源:UserModel.php

示例8: testAddingEnum

 public function testAddingEnum()
 {
     $blueprint = new Blueprint('users');
     $blueprint->enum('foo', array('bar', 'baz'));
     $statements = $blueprint->toSql($this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table "users" add "foo" nvarchar(255) not null', $statements[0]);
 }
开发者ID:hochanh,项目名称:Bootsoft-Bowling,代码行数:8,代码来源:SqlServerSchemaGrammarTest.php

示例9: testAddingEnum

 public function testAddingEnum()
 {
     $blueprint = new Blueprint('users');
     $blueprint->enum('foo', array('bar', 'baz'));
     $statements = $blueprint->toSql($this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table `users` add `foo` enum(\'bar\', \'baz\') not null', $statements[0]);
 }
开发者ID:hochanh,项目名称:Bootsoft-Bowling,代码行数:8,代码来源:MySqlSchemaGrammarTest.php

示例10: _schema_switchableTable

 public static function _schema_switchableTable(\Illuminate\Database\Schema\Blueprint $table)
 {
     $table->enum('switch', ['启用', '禁用']);
     $table->index(['switch']);
     return $table;
 }
开发者ID:xjtuwangke,项目名称:laravel-models,代码行数:6,代码来源:SwitchableTrait.php

示例11: testAddingEnum

 public function testAddingEnum()
 {
     $blueprint = new Blueprint('users');
     $blueprint->enum('foo', ['bar', 'baz']);
     $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table users add ( foo varchar2(255) not null )', $statements[0]);
 }
开发者ID:mickael83,项目名称:Laravel-OracleDB,代码行数:8,代码来源:OracleDBSchemaGrammarTest.php


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