php 在app / Macros / Database / Schema中创建Blueprint类
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 在app / Macros / Database / Schema中创建Blueprint类相关的知识,希望对你有一定的参考价值。
<?php
namespace App\Macros\Database\Schema;
use Illuminate\Database\Schema\Blueprint as DefaultBlueprint;
/**
*
*/
class Blueprint
{
public static function registerMacros()
{
DefaultBlueprint::macro('hashslug', function () {
return $this->string('hashslug')->unique()->index();
});
DefaultBlueprint::macro('name', function () {
return $this->string('name');
});
DefaultBlueprint::macro('uniqueEmail', function () {
return $this->string('email')->unique();
});
DefaultBlueprint::macro('password', function () {
return $this->string('password');
});
}
}
以上是关于php 在app / Macros / Database / Schema中创建Blueprint类的主要内容,如果未能解决你的问题,请参考以下文章