Monday, December 2, 2013


Enough with Javascript
for a bit, I might be losing some touch in PHP so I'm going Laravel this time around.

How I'm using Laravel

Currently I'm using Laravel framework on building a RESTFul API after jumping from many different frameworks such as Slim Framework and Frapi. And this might affect my writing of this article regarding Laravel since I may not include some templating topics and other frontend stuff that Laravel can do.

What is Laravel ?

Laravel is like any other PHP frameworks such as CakePHP, CodeIgniter and Zend Framework. Of course it has it's own strengths and weaknesses but I'm thinking not to add that since it's the developers duty to find out what is lacking for him/her.

Laravel is Composer Ready!

I asked one of my colleague who is claiming that he is a "PHP master" and he can code PHP even if he is blind-folded. And when I asked him if he is using Composer and Packagist he says he doesn't know about those (sad face). Well anyway, I'm not saying all PHP developer should know about Composer but it is good knowing that you doing it in your project and Laravel is very Composer ready.

Imagine you can build Laravel application within seconds without copying and pasting additional plugins and getting it from all over the web. You can do it by creating a simple configuration file in JSON format and include your code dependencies and required plugins, then Composer can collate and build an app for you.

If your familiar with Yeoman for Javascript application , Composer is for PHP application.

Routing and RESTFul Controller

Actually this is one my favorite feature of Laravel, its RESTFul Controller. Since I'm developing an API, Laravel's approach of Controller really gave ease of doing some work and understanding on how this great framework works. 

If you notice I didn't mention routing well this two comes along with each other if you want a controller you need a routing code to activate or access it.

It really depends on you on how to use this feature of Laravel for me I use those HTTP verbs for API operation like if GET then get data and POST if inserting. You can set a get Controller and just show an html or create a POST controller which handles form submits.

Next Part

I will be tackling some information for authentication for controller and database migration topics.


1 comment: