What sets Laravel apart from other PHP web frameworks? Speed and simplicity, for starters. This rapid application development framework and its ecosystem of tools let you quickly build new sites and applications with clean, readable code.
Fully updated to cover Laravel 5.8, the second edition of this practical guide provides the definitive introduction to one of today’s mostpopular web frameworks.
Matt Stauffer, a leading teacher and developer in the Laravel community, delivers a high-level overview and concrete examples to help experienced PHP web developers get started with this framework right away.
This updated edition also covers Laravel Dusk and Horizon and provides information about community resources and other noncore Laravel packages.
Dive into features, including:
Blade, Laravel’s powerful custom templating tool
Tools for gathering, validating, normalizing, and filtering user-provideddata
The Eloquent ORM for working with application databases
The role of the Illuminate request object in the application lifecycle
PHPUnit, Mockery, and Dusk for testing your PHP code
Tools for writing JSON and RESTful APIs
Interfaces for filesystem access, sessions, cookies, caches, and search
Tools for implementing queues, jobs, events, and WebSocket event publishing
What This Book Is About
This is not the first book about Laravel, and it won’t be the last. I don’t intend for this to be a book that covers every line of code or every implementation pattern.
I don’t want this to be the sort of book that goes out of date when a new version of Laravel is released. Instead, its primary purpose is to provide developers with a high-level overview and concrete examples to learn what they need to work in any Laravel codebase with any and every Laravel feature and subsystem. Rather than mirroring the docs, I want to help you understand the foundational concepts behind Laravel.
Laravel is a powerful and flexible PHP framework. It has a thriving community and a wide ecosystem of tools, and as a result it’s growing in appeal and reach. This book is for developers who already know how to make websites and applications and want to learn how to do so well in Laravel.
Laravel’s documentation is thorough and excellent. If you find that I don’t cover any particular topic deeply enough for your liking, I encourage you to visit the online documentation and dig deeper into that particular topic.
I think you will find the book a comfortable balance between high-level introduction and concrete application, and by the end you should feel comfortable writing an entire application in Laravel, from scratch. And, if I did my job well, you’ll be excited to try.
Who This Book Is For
This book assumes knowledge of basic object-oriented programming practices, PHP (or at least the general syntax of C-family languages), and the basic concepts of the Model–View–Controller (MVC) pattern and templating.
If you’ve never made a website before, you may find yourself in over your head. But as long as you have some programming experience, you don’t have to know anything about Laravel before you read this book—we’ll cover everything you need to know, from the simplest “Hello, world!”
Laravel can run on any operating system, but there will be some bash (shell) commands in the book that are easiest to run on Linux/macOS. Windows users may have a harder time with these commands and with modern PHP development, but if you follow the instructions to get Homestead (a Linux virtual machine) running, you’ll be able to run all of the commands from there.
1. Why Laravel?
2. Setting Up a Laravel Development Environment
3. Routing and Controllers
4. Blade Templating
5. Databases and Eloquent
6. Frontend Components
7. Collecting and Handling User Data
8. Artisan and Tinker
9. User Authentication and Authorization
10. Requests, Responses, and Middleware
11. The Container
13. Writing APIs
14. Storage and Retrieval
15. Mail and Notifications
16. Queues, Jobs, Events, Broadcasting, and the Scheduler
17. Helpers and Collections
18. The Laravel Ecosystem
About the Author
Matt Stauffer is a developer and a teacher. He is a partner and technical director at Tighten Co., blogs at mattstauffer/co, and hosts The Five-Minute Geek Show and the Laravel Podcast.