In this video, learn how to test your Laravel application when you are uploading files through a web form.
- [Instructor] One of the features we've built … into our application at this point is our file uploader. … This is one of the things that might seem … like it might be super tricky … in a normal application to test, … but Laravel again is going to make it … straight forward for us. … Open up the room type controller at app, Http, Controllers, … RoomTypeController.php. … On line 74 is where we save our file paths in. … We can update this to make it simpler to test, … now that we know what facades are and how to use them. … We're going to replace the second part of line 74, … where we request file picture store public … to instead read as storage, … so we're going to use the storage facade. … Colon, colon, putFile, which is a function. … Our first parameter will be public for where we're … storing the file. … And then we're going to pass in the actual file we … want to store. … In this case it's going to be request, arrow, file, … and then in parenthesis picture. … And now that we have a facade that we can mock …
Author
Released
12/16/2019- Saving and viewing files
- Displaying validation errors
- Console commands, outputs, arguments, and inputs
- Building a Laravel route that has multiple parameters
- Working with the Laravel authentication system
- Preparing for deployment
Skill Level Intermediate
Duration
Views
Related Courses
-
Advanced Laravel
with Justin Yost2h 20m Advanced -
Building RESTful APIs in Laravel
with Justin Yost2h 19m Intermediate -
PHP: Creating Secure Websites
with Kevin Skoglund4h 15m Intermediate -
Ajax with PHP: Add Dynamic Content to Websites
with Kevin Skoglund3h 37m Intermediate
-
Introduction
-
1. Beyond the Basic Form
-
Saving files10m 11s
-
Viewing files3m 51s
-
Validation6m 6s
-
Displaying validation errors4m 33s
-
Displaying old input3m 25s
-
-
2. Artisan Console
-
Console commands5m 43s
-
Console outputs5m 1s
-
Console arguments5m 22s
-
Console options4m 32s
-
Console inputs5m 54s
-
-
3. Service Container
-
Service providers6m 39s
-
Facades4m 9s
-
-
4. Testing
-
Basic test5m 12s
-
Database factories10m 9s
-
As a user3m 41s
-
Facades5m 47s
-
File uploads5m 45s
-
Console commands9m 14s
-
-
5. Notifications
-
Emails8m
-
Notifications5m 34s
-
Queue jobs6m 2s
-
Queue workers5m 41s
-
Task scheduler6m 25s
-
-
6. Routing
-
Route parameters5m 56s
-
Route model binding3m 33s
-
Middleware4m 29s
-
-
7. Laravel Mix
-
CSS processing6m 20s
-
JavaScript processing4m 36s
-
8. Security
-
Authentication4m 56s
-
Route authorization4m 43s
-
Verified users2m 58s
-
Encryption3m 20s
-
Password storage7m 17s
-
-
9. Deployment
-
Preparing for deployment5m 37s
-
Databases4m 54s
-
Deploying a change1m 20s
-
-
Conclusion
-
Next steps1m 5s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: File uploads