Laravel may be one of the younger frameworks out there but it’s making ripples in the PHP world. The following post teaches how to build a basic to-do application in Laravel 4. It covers a wide range of concepts, links to relevant learning material where possible and should make for a great introduction to the framework.
This tutorial is relatively long so I’ve broken it up into multiple posts.
- Part 1 – Installation, Database and Routes
- Part 2 – Listing Projects and Tasks
- Part 3 – Create/Edit/Delete
- Part 4 – Validation and Slugs
Today will cover installation, configuration, artisan, migration, seeding and routes.
Before you Begin
Before you begin there are a few great resources you should check out.
You won’t get far in the Laravel world without hearing about Jeffrey Way. Jeffrey has perhaps done more for the Laravel community than any other non-core developer. He has produced high-quality, comprehensive video tutorials on almost every aspect of L4, many of which are free to view and aimed at beginners. I would highly recommend you check out the following pieces of his work:
- Laravel 4 Mastery – although older (from the L4 beta days), it’s mostly still relevant. Aimed at beginners and quite comprehensive
- Laravel From Scratch – in many ways an updated version of Laravel 4 Mastery. Not as comprehensive but a great compliment to the above
- Laracasts – Mostly paid for videos of very high quality. New videos are regularly created and one a week is made free.
There are a few other places to find news and information:
- The Laravel Twitter feed – for the latest breaking news on L4 development
- Laravel.io – Weekly roundups that gather the latest news and tutorials from around the web. They also do a weekly podcast that often includes the framework author Taylor Otwell
- Laravel Packages Registry – good place to go to find some of the best L4 packages
- Code Bright – An e-book provided free of charge by framework author Dayle Rees
Our to-do application will consist of one or more projects, each with its own list of tasks. You will be able to create, list, modify and delete both tasks and projects.
In this lesson we will go through:
- Installing and setting up Laravel 4
- Installing extra packages that will make development easier
- Using migrations and seeds
- Learning how to use resourceful controllers
- Learning how to use views (including the blade templating language and content layouts
- Handling model relations