本文整理匯總了PHP中app\models\Article::getTableName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Article::getTableName方法的具體用法?PHP Article::getTableName怎麽用?PHP Article::getTableName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Article
的用法示例。
在下文中一共展示了Article::getTableName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(\App\Models\ArticlePermalink::getTableName(), function (Blueprint $table) {
$table->string('permalink', 255)->primary();
$table->uuid('article_id')->index()->nullable();
$table->dateTime('created_at');
$table->dateTime('updated_at')->nullable();
$table->foreign('article_id')->references('article_id')->on(\App\Models\Article::getTableName())->onDelete('cascade');
});
}
示例2: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(\App\Models\ArticleMeta::getTableName(), function (Blueprint $table) {
$table->uuid('article_id');
$table->string('meta_name', 255);
$table->string('meta_content', 255)->nullable();
$table->string('meta_property', 255)->nullable();
$table->dateTime('created_at');
$table->dateTime('updated_at')->nullable();
$table->primary(['article_id', 'meta_name']);
$table->foreign('article_id')->references('article_id')->on(\App\Models\Article::getTableName())->onDelete('cascade');
});
}
示例3: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table(\App\Models\Article::getTableName(), function (Blueprint $table) {
$table->dropForeign('articles_permalink_foreign');
});
}
開發者ID:TFidryForks,項目名稱:spira,代碼行數:11,代碼來源:2015_07_28_005041_add_permalink_foreign_key_to_articles_table.php