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 😀

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”