diff --git a/app/Article.php b/app/Article.php new file mode 100644 index 0000000..ace0edb --- /dev/null +++ b/app/Article.php @@ -0,0 +1,9 @@ +bigIncrements('id'); + $table->text('title')->comment('標題'); + $table->text('content')->nullable()->comment('內容'); + $table->text('excerpt')->nullable()->comment('摘要'); + $table->unsignedBigInteger('user_id')->comment('作者'); + $table->unsignedBigInteger('feature_image_id')->nullable()->comment('主圖'); + $table->timestamps(); + + $table->foreign('user_id')->references('id')->on('users'); + $table->foreign('feature_image_id')->references('id')->on('media_files'); + } +} diff --git a/config/data-presets.php b/config/data-presets.php index bc4a952..156f110 100644 --- a/config/data-presets.php +++ b/config/data-presets.php @@ -68,6 +68,22 @@ return [ 'editor' ] ], + [ + // 管理Article + 'name' => 'admin manage post article', + 'displayName' => 'adminManagePostArticle', + 'assignTo' => [ + 'editor' + ] + ], + [ + // 管理Portfolio + 'name' => 'admin manage post portfolio', + 'displayName' => 'adminManagePostPortfolio', + 'assignTo' => [ + 'editor' + ] + ], ], // 預設的設定值 'options' => [ diff --git a/config/posts.php b/config/posts.php new file mode 100644 index 0000000..84cc13b --- /dev/null +++ b/config/posts.php @@ -0,0 +1,5 @@ +processSchema($table); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('articles'); + } +} diff --git a/database/migrations/2020_02_23_064813_create_portfolios_table.php b/database/migrations/2020_02_23_064813_create_portfolios_table.php new file mode 100644 index 0000000..d57fe65 --- /dev/null +++ b/database/migrations/2020_02_23_064813_create_portfolios_table.php @@ -0,0 +1,33 @@ +processSchema($table); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('portfolios'); + } +}