public function toggleApproved($id) { $comment = Comment::find($id); $comment->approved = $comment->approved ? false : true; $comment->save(); return redirect('admin/comments'); }
public function run() { \StartPoint\Comment::updateOrCreate(['id' => 1, 'name' => 'Visitor 1', 'post_id' => 1, 'body' => 'test comment 1', 'email' => '*****@*****.**']); \StartPoint\Comment::updateOrCreate(['id' => 2, 'name' => 'Visitor 2', 'post_id' => 1, 'body' => 'test comment 2', 'email' => '*****@*****.**']); }