About the Author |
|
xi | |
About the Technical Reviewer |
|
xiii | |
Acknowledgments |
|
xv | |
Introduction |
|
xvii | |
Chapter 1 Introduction to Laravel |
|
1 | (10) |
|
|
1 | (2) |
|
|
3 | (8) |
|
|
7 | (2) |
|
How the MVC Pattern Works |
|
|
9 | (2) |
Chapter 2 Setting Up Your Environment |
|
11 | (30) |
|
|
11 | (5) |
|
Installing Composer Globally |
|
|
12 | (1) |
|
Installing Laravel Globally |
|
|
13 | (1) |
|
Installing Laravel Locally with Composer |
|
|
14 | (2) |
|
Introduction to Homestead, Valet, and Forge |
|
|
16 | (21) |
|
Forge: Painless PHP Servers |
|
|
18 | (1) |
|
Installing VirtualBox and Vagrant |
|
|
19 | (6) |
|
Installing Homestead Using Vagrant |
|
|
25 | (2) |
|
|
27 | (1) |
|
Shared Folders and Homestead |
|
|
28 | (3) |
|
Launching the Vagrant Box |
|
|
31 | (3) |
|
|
34 | (3) |
|
How to Create a New Laravel Project |
|
|
37 | (4) |
Chapter 3 Routing, Controllers, Templates, and Views |
|
41 | (34) |
|
|
41 | (7) |
|
How to Find the Default Route Files |
|
|
42 | (1) |
|
Route and RESTful Controller |
|
|
43 | (1) |
|
|
43 | (5) |
|
Creating Controllers, Views, and Managing Routes |
|
|
48 | (14) |
|
CRUD and the Seven Methods |
|
|
51 | (7) |
|
Models Acts as a Resource |
|
|
58 | (3) |
|
|
61 | (1) |
|
|
62 | (3) |
|
The Importance of the Resourceful Controller |
|
|
64 | (1) |
|
How to Supplement the Resource Controller |
|
|
64 | (1) |
|
Getting User Input and Dependency Injection |
|
|
65 | (3) |
|
How a Blade Template Works with Controllers and Models |
|
|
68 | (7) |
|
|
70 | (1) |
|
Authentication Through Blade |
|
|
70 | (1) |
|
Control Structures in Blade |
|
|
71 | (1) |
|
Other Advantages of Blade Templates |
|
|
72 | (3) |
Chapter 4 Working with Models |
|
75 | (38) |
|
Route Model Binding: Custom and Implicit |
|
|
75 | (5) |
|
|
78 | (1) |
|
|
79 | (1) |
|
|
80 | (24) |
|
How Migrations Work with the Laravel Model |
|
|
81 | (11) |
|
|
92 | (5) |
|
|
97 | (7) |
|
Relations Between Model, Database, and Eloquent |
|
|
104 | (9) |
|
Creating Views to Show Relationships |
|
|
106 | (7) |
Chapter 5 Database Migration and Eloquent |
|
113 | (54) |
|
Introduction to Migration |
|
|
113 | (1) |
|
|
114 | (1) |
|
Introduction to Eloquent Relations |
|
|
115 | (1) |
|
|
116 | (5) |
|
|
121 | (7) |
|
|
128 | (4) |
|
|
132 | (4) |
|
|
136 | (6) |
|
|
142 | (14) |
|
|
143 | (1) |
|
|
144 | (12) |
|
Summarizing All Relations |
|
|
156 | (11) |
Chapter 6 Handling User Data and Redirects |
|
167 | (40) |
|
How Redirect Methods Work |
|
|
168 | (4) |
|
What Is a Request Object? |
|
|
172 | (2) |
|
How Requests and Responses Work |
|
|
174 | (1) |
|
|
175 | (6) |
|
|
181 | (21) |
|
Using the Laravel HTML and Form Packages |
|
|
182 | (4) |
|
|
186 | (3) |
|
The Traditional Way of Form Inputs |
|
|
189 | (13) |
|
|
202 | (5) |
Chapter 7 Using Tinker |
|
207 | (6) |
|
Handling a Database Using Tinker |
|
|
207 | (4) |
|
|
211 | (2) |
Chapter 8 Authentication, Authorization, and Middleware |
|
213 | (80) |
|
Different Authentication Methods in the Company/Project/Task Management Application |
|
|
214 | (14) |
|
How Auth Controller Works and What Auth Middleware Is |
|
|
228 | (7) |
|
Middleware, Authentication, and Authorization in One Place |
|
|
235 | (31) |
|
The Company App's Model-View-Controller |
|
|
241 | (14) |
|
Home Page, Redirection, and Authentication |
|
|
255 | (8) |
|
Role of a User and Authorization |
|
|
263 | (3) |
|
Authorization Through the Blade Template |
|
|
266 | (13) |
|
Implementing Authorization Using Gates and Policies |
|
|
279 | (14) |
|
|
281 | (4) |
|
|
285 | (2) |
|
|
287 | (6) |
Chapter 9 Containers and Facades |
|
293 | (20) |
|
|
293 | (3) |
|
Single Responsibility Principle |
|
|
294 | (1) |
|
The Open-Closed Principle |
|
|
294 | (1) |
|
Liskov Substitution Principle |
|
|
295 | (1) |
|
The Interface Segregation Principle |
|
|
295 | (1) |
|
Dependency Inversion Principle |
|
|
295 | (1) |
|
Interfaces and Method Injection |
|
|
296 | (1) |
|
|
297 | (4) |
|
How a Container Works in Laravel |
|
|
301 | (5) |
|
|
306 | (7) |
Chapter 10 Working with the Mail Template |
|
313 | (28) |
|
|
313 | (10) |
|
Using Tinker to Find the Verified E-mail |
|
|
319 | (2) |
|
|
321 | (2) |
|
Sending E-mail and Notifications |
|
|
323 | (18) |
|
|
324 | (10) |
|
How to Send Notifications |
|
|
334 | (7) |
Chapter 11 Events and Broadcasting |
|
341 | (26) |
|
What Are Events and Broadcasting? |
|
|
341 | (1) |
|
Setting Up Events and Broadcasting |
|
|
342 | (25) |
|
|
343 | (14) |
|
|
357 | (9) |
|
|
366 | (1) |
Chapter 12 Working with APIs |
|
367 | (32) |
|
|
367 | (1) |
|
|
368 | (17) |
|
Working with Laravel Passport |
|
|
385 | (10) |
|
|
395 | (4) |
Appendix: More New Features in Laravel 5.8 |
|
399 | (16) |
|
What Is the Dump Server Feature? |
|
|
399 | (8) |
|
|
407 | (3) |
|
|
410 | (3) |
|
Renaming the Mail Format Folder |
|
|
410 | (1) |
|
|
410 | (1) |
|
Changing the Look of Error Pages |
|
|
411 | (1) |
|
Improving Array and String Helper Functions |
|
|
412 | (1) |
|
|
412 | (1) |
|
|
413 | (2) |
Index |
|
415 | |