本文整理汇总了PHP中Illuminate\Database\Schema\Blueprint::date方法的典型用法代码示例。如果您正苦于以下问题:PHP Blueprint::date方法的具体用法?PHP Blueprint::date怎么用?PHP Blueprint::date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Schema\Blueprint
的用法示例。
在下文中一共展示了Blueprint::date方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _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;
}
示例2: _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;
}
示例3: date
/**
* Campo DATA.
*/
public function date($column)
{
$col = parent::date(strtolower($column));
$col->nullable(true);
return $col;
}
示例4: testAddingDate
public function testAddingDate()
{
$blueprint = new Blueprint('users');
$blueprint->date('foo');
$statements = $blueprint->toSql($this->getGrammar());
$this->assertEquals(1, count($statements));
$this->assertEquals('alter table "users" add "foo" date not null', $statements[0]);
}
示例5: setDatabaseFieldType
/**
* @param Blueprint $table
*
* @return \Illuminate\Support\Fluent
*/
public function setDatabaseFieldType(Blueprint $table)
{
return $table->date($this->getDBKey())->default($this->getDatabaseDefaultValue());
}