What I learned in one week with Laravel 5 from Scratch—Part 1





For my first writing here on Medium I will tell you about my first week with this awesome PHP framework called Laravel.

So lets start with my PHP knowledge…..

I’m studying Media Technology right now at @fh_stpoelten in the fourth semester. In the third semester we started with PHP and we did several exercises to get better and get deeper in this whole PHP thingy. At the end of the third semester we had to do a project with PHP. I decided to create a tiny but super fine ;) CMS.

Before I started coding, I had two weeks vacation at home — so I was pretty relieved and stoked to get started with my PHP code. On Monday I started with straight PHP and it was a bloody mess. Nothing worked, I was totally wasted after a nine hour marathon and I thought about canceling the whole project and start all over again. In the evening I was talking to a friend of mine, he was actually a lector of mine too => @Codebryo and he convinced me to try Laravel. He mentioned I should start from scratch with Laravel 5 to be state of the art. So here I was. I had 20h of PHP training in school and now I should start with a totally new thing for me — a framework! WOW!

To be honest I was totally scared! On Tuesday morning I was really motivated and I managed to create a little CMS with PHP. At that point I knew if I really screw up with Laravel 5, I’ll still have a little CMS at the end which I could present on Friday. After a little lunch break I started with Laravel. @christophrumpel — a good friend on mine — pointed me towards Laracast — to start from scratch with some tutorials and so I did.

I found an awesome collection called “Laravel 5 From Scatch (Alpha)” and I digged into it.

Installation


First things first, lets get familiar with Composer. You can find everything you want to know about it on https://getcomposer.org/. In my words, Composer helps you to declare the libraries for your project and will install them too. My first little problem was that on OSX Yosemite the /usr directory does not exist by default. If you receive the error “/usr/local/bin/composer: No such file or directory” then you must create /usr/local/bin/ manually before proceeding.

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

After doing everything right, you can type:

$ composer

in your terminal and you should get this kind of screen:

The next step is the actual installation of Laravel 5.

composer global require "laravel/installer=~1.1"

As I mentioned before make sure to place the ~/.composer/vendor/bin directory in your PATH so the Laravel executable can be located by your system.

Don’t forget to edit your ~/.bash_profile file with your favourite editor. I like using vi

$ vi ~/.bash_profile

After that u can run Laravel and get started.

So that’s it from my first medium entry. I hope u liked it so far and you could use some help for the installation.

Next I will tell you about my first steps and the actual CMS!

-Take care