I recently purchased a Raspberry Pi 2 and have had it sitting around for about a week. With my birthday coming up, a day that coincides with Pi Day, I figured I might get started on using the Pi.  My wife and I have been developing websites both for fun and profit.  I have been wanting a way to inexpensively create some routing to our development environments when we need to demonstrate the sites as they are being developed.  I have also been wanting to play around a bit with node.js.  The stars aligned and I had a project in mind:  A Raspbery Pi setup as a reverse proxy to point to our development sites to our internal development machines/instances. 

Ok so with the Pi in hand, a 32Gb SD card, I began the journey by downloading a Pi image.  You can use just about any Pi image, however, I'd recommend Raspbian. 

 

This post is a follow-up to Posting Comments Using AJAX.  In this post I cover deleting comments using Javascript, Jquery, AJAX and of course our beloved Laravel.  I cover using route binding to reduce code later in the controller.  Remember to protect your route with your auth middleware!

Developing the CMS for Linuxphile has been an interative process.  I started with the authentication, which Laravel made, extremely simple, moved on to the content management side by reviewing editors, playing with a few, and integrating file browser and upload features in to each of the editors I reviewed. After the content piece was complete I worked on displaying the individual posts.  Recently, I have added the functionality for visitors to comment on posts. Go ahead, look below, you'll see the comment section and leave me some feedback.  I will likele be updating the display of the comments, but the basic idea is covered below. 

For those that do not know, I have used Laravel to create a custom content management system (CMS) for Linuxphile.  Laravel is a PHP framework that makes coding in PHP a dream.  Laravel and aritsan have rejevunated my lust for technology and very much my love of coding in PHP.  Alright, I'll stop cheesing about Laravel and get to the meat of this. 

When I set out to set things right (you remember, right, Linuxphile was hacked) I wanted to create, from the ground up, a CMS that would allow me full control, but still allow for ease of use.  To that end I knew from the beginning I'd be using some form of WYSIWYG editor.  These, typically javascript, editors just make posting new content to a website easier and faster.  My choices were really between CKEditor and TinyMCE, although I did go down the path of Nicedit too.  

TinyMCE is just that, tiny, but a full featured WYSIWYG editor and can be as bloated as you desire by enabling various plugins. For the most part the documentation is really straight forward.  I was able to get the file browser working within minutes, but the file upload feature required quite a bit more work.  Below are details one what I have done to get this working, with links to where I found pointers in the right direction. 

Well, it is quite embarrassing for me to admit, but Linuxphile was hacked.  I was a slacker neglecting to update the vulnerable version of Drupal the site was running.  Pure laziness.  I hadn't touched Linuxphile in months and event after a message from a user at Techguy.org letting me know the site was hacked, I put off looking in to it for a while.  It wasn't until Mike Cermak notified me of the abusive/fake paypal account affecting his other clients that I finally did something about it.  

That something wasn't to patch Drupal, nor to undo the hack.  I wiped out everything, taking only a backup of the database.  Clean!  

The site being hacked was actually a good thing for me.  I kept telling myself it was too hard to find time to dedicate to the site with the size of my family.  Five kids; can you imagine?  Well I've found if I deprive myself of sleep I can in fact find time for the site.  I have gotten back in to technology as a hobby by re-writing the site from the ground up.