Diving into a new PHP framework: A journey to learn Laravel!

Laravel I’ve always loved Codeigniter, but I keep hearing the whispers of Laravel. So I’ve decided to make the leap and start to pick up the framework. I’ve been learning the ins and outs over the last few months. I have not been really dedicated to it, but I am starting to really focus in.

I have to say that I am really excited about some of the features, and the fact that the framework is very modern. I can’t wait until I break through this wall. I feel my speed of development will grow 10 fold over night. If you are looking for a PHP framework I would suggest Laravel as it will give you a good foundation, but also help you understand modern PHP.

I’m hoping that I can find times to post my journey as I progress through the framework. I know that some of my friends are also trying to learn Laravel, and I hope that I can help them with that as well. If you have any tips or tricks for me, let me know them. It might just speed me up even more 😀

Mr. Holmes Movie Review

Mr. Holmes I normally do not write about movies, but I thought it would be fun to start. I am very picky when it comes to movies. Most of the time I want to watch something that I can learn from. In this case, the movie I am writing about is Mr. Holmes.

Mr. Holmes is about an old and aged Sherlock Homes. A man trying to remember his last case and set the story straight. Dr. Watson had tweaked his character to make him more enjoyable, but Holmes was now trying to put the story back together the correct way. During the movie, the timeline flips between the present, his last case, and a trip to Japan.

In the present, Holmes is an aged man living on his own with a boy and his mother, a housekeeper. Holmes befriends the boy and mentors him after the boy falls in love with Holmes’ story. The boy helps holmes remember and helps with Holmes’ hobby of beekeeping.

As the boy requests more of the story, and holmes remembers you get ported back to the past to Holmes’ last case. The case involves a husband and his wife. Holmes is troubled by this case, but he does not remember why.

The movie is fantastic, and I am surprised I have not heard of it. Mr. Holmes is played by the amazing Ian McKellen (Gandalf – Lord of the Rings). Make sure you watch it until the credits, it can be hard at times, based on the story, and not the acting.

What is an API?

api Sometimes as developers, we have things we need to do that we wish someone else could do for us. Chances are someone might have already done it for you. When you start programming you learn to do stuff on your own. Later, you learn of libraries and tools you can use from other developers. Sometimes, you might want to access another developer’s data, tools, or resources. Good examples of these things might be; getting Facebook friends, adding something to a calendar, or processing some data.

These types of activities might be out of the question, or hard to achieve on your own. However, many developers have APIs or Application Programming Interface that you can use. These might be free, or cost a little bit of money. The great thing about APIs is that they are EVERYWHERE. I am going to start off basic here and go into more depth in future posts. I just want to open your eyes to the opportunities.
Continue reading “What is an API?”

PHP Ternary Operator the One Line If Else

I don’t know if it is just me or not; I have always liked optimizing my code. The awesome feeling when you learn that new trick and you cut your code from ten to three lines. It’s like leveling up in a game (insert Link getting loot sound here).

One of the biggest moments I can remember is when I discovered the Ternary Operator. What is that you ask?: It is basically an if/else statement on one line. Let’s look at an example of typical code.

if($level >= 10) {
    $sword = 'LEGENDARY';
} else {
    $sword = 'Pointy Stick';
}

So here we have five lines of code. It seems pretty straightforward, but can we optimize it more?: Yes, we can!
Continue reading “PHP Ternary Operator the One Line If Else”

PHP 5.5+ Secure Password Hashing

PHP 5.5+ Password Hashing
PHP 5.5+ Password Hashing
PHP’s approach to password hashing has quite a history. These methods still litter the tutorials and guide new developers down dangerous paths. Let us take a look at the history so you know where you stand. Even though this post is for PHP, this history may still affect you.

Bad: Raw Password Storage
The first method was just to store the user’s password in plain text just like the user entered it. It was easy; the user would enter their password, and you would just compare the two passwords. If they matched, you were done.

The Issue: If a hacker gets access to your database or somehow gets a user’s password to print out on the screen then it’s over.

Bad: Encrypting Passwords
The next way a developer might think about storing passwords is by encrypting them. The developer takes the user’s new password encrypts it and saves that to the database. When the user goes to login again, you simply take the encrypted password out decrypt it, compare it and success.

The issue: This is still reversible, and the hacker can still decrypt the passwords to what the user entered if the database is hacked. The user, hacker, and even you as the developer should never be able to see the password after it is saved.
Continue reading “PHP 5.5+ Secure Password Hashing”