add news post stuff to setup command

This commit is contained in:
flash 2016-12-21 21:05:11 +01:00
parent 7c6a3eb4fa
commit ceab147eb3

View file

@ -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.");
}