15
Building Dynamic Web Apps with Laravel Eric Ouyang CS50 Seminar Friday, November 7th, 2014

with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Embed Size (px)

Citation preview

Page 1: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Building Dynamic Web Appswith Laravel

Eric Ouyang

CS50 SeminarFriday, November 7th, 2014

Page 2: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

So… what's Laravel?

Page 3: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Laravel is a…

MVC web app framework

Page 4: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Key features

Page 5: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

ORM

Object relational mapping is powerful and easy-to-use

Page 6: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Inheritable templates

Laravel's template engine, Blade, is pretty awesome

Page 7: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Migrations

Represent database schema changes in code

Page 8: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Composer

Use other people's code to do awesome things

Page 9: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Let's get started

Page 10: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Install composer

curl -sS https://getcomposer.org/installer | php

sudo mv composer.phar /usr/local/bin/composer

Page 11: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Create a new Laravel project

composer create-project laravel/laravel your-project-name --prefer-dist

If we were starting from scratch...

But, we're going to instead start with this...

git clone https://github.com/ericouyang/blog50.git

Page 12: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Install dependencies

composer install

Inside the blog50 directory run

Page 13: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Run the server

php artisan serve

Inside the blog50 directory run

..and then go to http://localhost:8000 in your browser!

Page 14: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Get the completed example

git clone -b completed https://github.com/ericouyang/blog50.git

We need to get the “completed” branch from GitHub

Page 15: with Laravel Building Dynamic Web Appscdn.cs50.net/2014/fall/seminars/laravel/laravel.pdf · Create a new Laravel project composer create-project laravel/laravel your-project-name

Thanks!

Useful links

Laravel website: http://laravel.com/Initial code: https://github.com/ericouyang/blog50

Completed example: https://github.com/ericouyang/blog50/tree/completed

If you want to get in touch…

@[email protected]