本文整理匯總了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());
}