Laravel so far

Like any developer, aka working product manager, I am often in search of new tools to add to my development tool belt. We’ve all asked and answered the same question, “What is the best product to perform X?”. Answer: “Whichever one you know”. However, no matter what technology is in your tool belt, adding one more is never a bad idea, keeps you current and, most importantly, employable.

With that in mind, I have started learning Laravel as a potential framework for the main application I manage at work. I have tried before, but with limited (and mixed) results. This time, I had no choice as I hired someone to work on a related project and they were familiar with Laravel. I have used CodeIgniter, Kohana and played with Yii, but Laravel has become the framework I hear most about these days. It was time to start learning in earnest.

I decided to start where most folks will, on the installation page. After working my way down the page and selecting to use the Homestead VM, my first roadblock appeared.

From the Laravel Homestead docs page: https://laravel.com/docs/5.2

Via Laravel Installer

First, download the Laravel installer using Composer:

composer global require "laravel/installer"

Make sure to place the ~/.composer/vendor/bin directory (or the equivalent directory for your OS) in your PATH so the laravel executable can be located by your system.

What is not explicitly mentioned, and which I did not clearly understand, is this should be performed on your host machine (Mac in my case). This makes sense since you are not using the Homestead VM for editing, only testing/development. Once this step has completed, you can then run:

laravel new blog

This will create your first Laravel application. This was a much longer set-up than I expected, mostly due to my misunderstanding the documentation.

In my zeal to continue learning about Laravel, I jumped into a “Step by Step guide to building your first Laravel application” by Eric Barnes. Unfortunately, the author also expects you to have understood how the Homestead VM and you host machine are intended to work together. After making some changes to the database file, he tells you:

Save the file and run the migration:

php artisan migrate

I quickly received the following error:

[PDOException]
SQLSTATE[HY000] [2002] Connection refused

Again, I failed to understand this should have been done on the Homestead VM. Why? Simple. The database is hosted on the VM. Any migrations which use the Laravel connection and are set to Localhost need to be done, you know, locally. It was a facepalm moment, thankfully done in the quiet of my office.

In case it helps, this is the MySQL connection array:

'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'homestead'),
'username' => env('DB_USERNAME', 'homestead'),
'password' => env('DB_PASSWORD', 'secret'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
],

You can see I had to change the Database, Username and Password fields from the default Laravel application to those used by Homestead. These are, obviously, for a testing/development environment. You would never publish actual database username and passwords. Once that was all sorted out, I received the expected response:

Migrated: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrated: 2016_03_08_215310_create_links_table

I was now well on my way.

UPDATE: Mac OS X method for including Composer to bash shell: http://stackoverflow.com/questions/25373188/laravel-installation-how-to-place-the-composer-vendor-bin-directory-in-your

Moved to WPEngine.com

After much thought and (a little) hand wringing, I have decided to move Laterboy.com to the WPEngine.com dedicated WordPress hosting platform. So far, it has been a difficult process to extract it from my Bitnami managed Amazon Web Services (AWS) account. But now that the process is complete, I look forward to a (much) faster website and perhaps fewer problems for me to manage.

I don’t like paying for something I can do myself, but time is also money in my world. Between a wife, three kids and 1 1/2 full time jobs, I will take the help at this point. I will update periodically with my experiences and overall thoughts. So far, it was easy(ish) to move my things over. The real problem was the ridiculously hard process of exporting my database from AWS. Bitnami makes the default phpMyAdmin secure by allowing only localhost access. Great. I love it. But, even after gaining “local” access for my laptop, it would not accept my password. After many attempts and an hour later, I just entered my WP database credentials and moved on.

I wish I could have that hour back.

I then followed the copious WP Engine steps for setting up my new install. Overall, it was fairly easy. The devs and product managers at WP Engine should be proud of their setup. From start to finish, it took me less than thirty (30) minutes. I have moved WP installs with iTheme’s Backup Buddy and they also took thirty minutes. The main difference is that iTheme will change your URLs for the new site while WP Engine assumes you are using the same one. It’s a safe guess, but not in my case. The Bitnami WordPress install script has everything under 127.0.0.1 and I had to edit my database to gain admin access. Once that was accomplished, everything fell into place. Oh yeah, I already changed my DNS so it propogated more quickly. WP Engine tells you to test it out, but hey, I went for it.

Here’s to my first hour on WP Engine. I hope there are many more to come.

Is Oracle Killing the Web?

Should this come to pass, numerous products will suddenly find themselves on an uncertain legal standing in which the previously benign but now newly empowered copyright holders might assert punitive copyright claims. Chief among these would be any re-implementation of an existing language. So, Jython, IronPython, and PyPy for Python; JRuby, IronRuby, and Rubinius for Ruby; Mono for C# and VB; possibly C for C, GCC for C and C and Objective-C; and so forth. And of course, all the various browsers that use JavaScript might owe royalties to the acquirers of Netscape’s intellectual property.

Oracle and the End of Programming As We Know It | Dr Dobb’s

This is certainly something to keep watching. If Oracle wins this fight, derivative works will dry up. Few volunteer efforts would risk a hefty legal bill for something that may/may not pan out.

Really sad.