From ceab147eb36d6194586f782b92f16dbd2dfdaffb Mon Sep 17 00:00:00 2001 From: flashwave Date: Wed, 21 Dec 2016 21:05:11 +0100 Subject: [PATCH] add news post stuff to setup command --- app/Console/Command/SetupCommand.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Console/Command/SetupCommand.php b/app/Console/Command/SetupCommand.php index b886e31..15e0ea9 100644 --- a/app/Console/Command/SetupCommand.php +++ b/app/Console/Command/SetupCommand.php @@ -320,6 +320,19 @@ class SetupCommand extends Command // Set the main rank to bot $botUser->setMainRank(config('rank.bot')); + // Add a news category and post + $news_category_id = DB::table('news_categories')->insertGetId([ + 'category_name' => 'Site News', + 'category_description' => 'News regarding the website', + ]); + + DB::table('news_posts')->insert([ + 'category_id' => $news_category_id, + 'user_id' => $botUser->id, + 'post_title' => 'Welcome to Sakura!', + 'post_text' => "Hey! Thanks for installing Sakura, if you're here you probably don't need further instructions so have a good day.", + ]); + $this->getLogger()->writeln("Success! You can now start a development server use the serve command for mahou."); $this->getLogger()->writeln("The default username and password are both railgun."); }