Laravel: Code Smart
The Laravel Framework Version 5 for Beginners
Dayle Rees
This book is for sale at http://leanpub.com/codesmart
This version was published on 2016-05-21
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean
Publishing process. Lean Publishing is the act of publishing an in-progress ebook
using lightweight tools and many iterations to get reader feedback, pivot until you
have the right book and build traction once you do.
© 2014 - 2016 Dayle Rees
Tweet This Book!
Please help Dayle Rees by spreading the word about this book on Twitter!
The suggested tweet for this book is:
I’m learning @laravelphp with #codesmart by @daylerees. Get it at
https://leanpub.com/codesmart
The suggested hashtag for this book is #codesmart.
Find out what other people are saying about the book by clicking on this link to
search for this hashtag on Twitter:
https://twitter.com/search?q=#codesmart
Also By Dayle Rees
Laravel: Code Happy
Laravel: Code Happy (ES)
Laravel: Code Happy (JP)
Laravel: Code Bright
Code Happy (ITA)
Laravel: Code Bright (ES)
Laravel: Code Bright (SR)
Laravel: Code Bright (JP)
Laravel: Code Bright (IT)
Laravel: Code Bright (TR) Türkçe
Laravel: Code Bright (PT-BR)
PHP Pandas (PHP7!)
Laravel: Code Bright (RU)
PHP Pandas (ES)
PHP Pandas (IT)
PHP Pandas (FR)
PHP Pandas (TR)
PHP: Composer
Contents
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Errata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
How to read this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Beginners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Experienced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2. Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Install Software Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Create a Laravel Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Install Homestead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Mastering Vagrant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3. Valet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Adding Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Valet Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4. Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12