Building Dynamic Web Apps
with Laravel
Eric Ouyang
CS50 Seminar
Friday, November 7th, 2014
So… what's Laravel?
Laravel is a…
MVC web app framework
Key features
ORM
Object relational mapping is powerful and easy-to-use
Inheritable templates
Laravel's template engine, Blade, is pretty awesome
Migrations
Represent database schema changes in code
Composer
Use other people's code to do awesome things
Let's get started
Install composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Create a new Laravel project
If we were starting from scratch...
composer create-project laravel/laravel your-project-name --prefer-dist
But, we're going to instead start with this...
git clone https://github.com/ericouyang/blog50.git
Install dependencies
Inside the blog50 directory run
composer install
Run the server
Inside the blog50 directory run
php artisan serve
..and then go to http://localhost:8000 in your browser!
Get the completed example
We need to get the “completed” branch from GitHub
git clone -b completed https://github.com/ericouyang/blog50.git
Thanks!
If you want to get in touch…
@OuyangEric
[email protected]
Useful links
Laravel website: http://laravel.com/
Initial code: https://github.com/ericouyang/blog50
Completed example: https://github.com/ericouyang/blog50/tree/completed