Pass parameters to middleware in Laravel 5

I recently had the need to pass parameters to middleware for authentication purposes. I wanted to declare a custom role for each route, have that role passed to the middleware, and if the user held that role the route would pass. The solution actually turned out to be quite simple and using a solution I found for Laravel 4 I was able to make this work for Laravel 5. In particular I made this solution for use with Cartalyst Sentry, but can be easily adapted to work with any use. First things first, let's create a simple middleware. We will call this RoleChecker and save it to the Http\Middleware directory. Note that you will need to change the "YourAppNameHere" name to work with your installation. [crayon-5569d58f651d0691585548/] Now we need Laravel to recognize our custom middleware so we open the Http/Kernel.php file and add the following line to the $routeMiddleware array: [crayon-5569d58f651e2062186051/] Finally, we can start passing parameters to our … [Read more...]

mySQL Foreign Key On Delete Cascade Not Working

I am embarrassed to say I spent 3 hours today trying to figure out why my foreign keys were not working properly in mySQL. I had several child tables that all had records related to a parent table and was utilizing foreign keys with on delete cascade set up to automatically delete records in the child tables. I went through the common symptoms: Using InnoDB engine on the tables in question (mySQL defaults to myISAM if you don't specify and myISAM does not support foreign keys). Charsets and collation are identical on all parent and child tables. Datatypes are the same for the columns. Index set on columns in child tables and in parent table if not primary keys. No inline references on the column specifications I tried recreating the tables, removing and recreating the indexes, removing and recreating the foreign keys, and always checking the error logs. Nothing worked. I searched Google up and down (at least I thought I did) and couldn't find anything either. … [Read more...]

Quick thoughts on the Google Europe Antitrust Accusation

Today's news is highlighted by the European Union bringing a formal antitrust complaint against Google. I for one have a big problem with this complaint. While I have not fully read the complaint I am going to make several assumptions here. The first assumption I will make is that the complaint primarily focuses on the Google search results and, in particular, results returned when a user searches for a product or is "shopping". The second assumption I will make is that the first assumption is not the entire case against Google. I make the second assumption only because if it is, it shows how far out of touch some people are with technology and how it is utilized. I say this because I don't think the EU has a good case for the first assumption. The articles I have read today all speak of how the EU sees Google returning results that have been paid for (sponsored) at the top of the search results over competitors as anti-competitive. First, let's simplify this a bit. If I turn on the … [Read more...]

Install OrientDB on Ubuntu 12.04

Install OrientDB First things first let's make sure everything is up-to-date on our system and you have the Java Development Kit installed: [crayon-5569d58f6676c423319887/] Pick a spot for the OrientDB install: [crayon-5569d58f6677a812806895/] Download the latest version of OrientDB (Note: This downloads the community edition of OrientDB) [crayon-5569d58f66783398693773/] Once we have downloaded the file go ahead an unpack it: [crayon-5569d58f6678b516287122/] Once you have unpacked the tar file, to make things easy to work with you can delete the tar file. Also, to make directory names simpler you can create a symlink to the version directory: [crayon-5569d58f66792628250127/] Once that is complete you will need to setup your username and password for the database: [crayon-5569d58f6679a423502280/] Go to the section <storages> (use Ctrl-W to search). You will have to add the following line between <storages> and … [Read more...]

The mixed up pricing of SiriusXM and SiriusXM Discounts

I had forgotten how frustrating dealing with SiriusXM pricing can be. After years of not having a subscription, I recently purchased a new car that included a free "All Access" trial. I had forgotten how much I enjoyed having SiriusXM over regular radio, especially since I live in an area with limited "regular" radio listening choices. As is typical of any free trial, you almost immediately start receiving mail and the occasional phone call offering some special. I knew I wanted to subscribe so I was just waiting for the best offer. Where SiriusXM gets you though is that they send you all the letters with these "specials" that sound too good to be true. But what the first difference is, is that these deals are for "Select" service NOT the "All Access" package. While the differences are slight, there is one big difference, that to be honest I enjoy and that is the Internet radio. I figure if I have SiriusXM and for an extra few dollars I can pay for Internet, I will go ahead and … [Read more...]

Linksys WRT1900AC & Samsung Galaxy S5

I was in desperate need for a little home network upgrade and after hearing rave reviews I decided to upgrade my home router to a Linksys WRT1900AC Wi-Fi Router. Immediately I saw a significant performance improvement over my old router with my desktop and using streaming services on my TV. However, my Samsung Galaxy S5 was having some serious issues when it came to wireless performance. My phone would connect to the router, and the router would show it was connected, yet when I would try to go to websites or use applications such as Facebook, I was met with significant delays and occasionally the phone disconnecting from the network. I immediately tried hooking up my old router and sure enough my phone worked perfectly so I knew it had to be something with the WRT1900AC. After searching around on Google for a bit I found several articles with people experiencing similar issues, although not directly related to the Galaxy S5. Most of the issues though seem to have been resolved with … [Read more...]

Happy New Year!

Just wanted to get a quick post up to say Happy New Year to everyone and thank you all for the continuous support. I have been slow to post recently, however, I promise with 2015 that I will make a valiant effort to post at least once a week. I am also going to be making some changes to the blog with a new theme and look for the new year. I will continue to post on topics such as WordPress, Bootstrap, and other technology related topics. So hope everyone had a safe and happy new year and looking forward to what the new year has in store! … [Read more...]

WordPress MailChimp Plugin – PressChimp

PressChimp is a WordPress MailChimp plugin unlike any other! With PressChimp you can easily manage every (well almost every) aspect of your MailChimp email marketing lists directly from within the WordPress dashboard. PressChimp allows you to easily add, edit, import, export subscribers. Add groups and segment subscribers based on your needs. Create custom signup forms for use as widgets in the sidebar, posts, pages, and footer. Create campaigns using one of the over 100 included pre-built themes and templates, design your own template, or import a third-party template. Include posts and images directly from your WordPress blog within the campaign. Schedule campaigns to go out with new posts using your template or theme. Set goals and engage your subscribers through built-in conversation management features. When it is all said and done view reports directly from within WordPress on your campaign performance. Compare your own campaigns or against industry averages. If you are using … [Read more...]