示例#1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $replies = Reply::all();
     $markdown = new Markdown();
     $transfer_count = 0;
     $convert_count = 0;
     foreach ($replies as $reply) {
         if (empty($reply->body_original)) {
             // store the original data
             $reply->body_original = $reply->body;
             // convert to markdown
             $reply->body = $markdown->convertMarkdownToHtml($reply->body);
             $reply->save();
             $transfer_count++;
         } else {
             // convert to markdown
             $reply->body = $markdown->convertMarkdownToHtml($reply->body_original);
             $reply->save();
             $convert_count++;
         }
     }
     $this->info("Transfer old data count: " . $transfer_count);
     $this->info("Convert original to body count: " . $convert_count);
     $this->info("It's Done, have a good day.");
 }
示例#2
0
 public function show()
 {
     //顯示留言
     $users = User::orderBy('id', 'DESC')->paginate(10);
     $reply = Reply::all();
     $this->layout->content = View::make('users_main', array('users' => $users, 'replys' => $reply));
 }