This video will be available to
subscribers on Thu, Jul 3, 2025.
subscribers on Thu, Jul 3, 2025.
You must be a subscriber to view this video.
Jul 3, 2025
19m:17s
Uploading Photos
Classification
Software Engineering | Languages | PHP
Keywords
oop | php
About This Episode:
🔒 UI Adjustments Based on Auth State
• Hide the notification bell in the top nav if the user isn’t logged in
🧭 Routing & Form Setup
• Create an /upload route
• Set the form’s action and stub in the store() method with a dd($_POST) to start
• Remove the unused “title” field from the upload form
🧪 Validation Process
• Define validation for the uploaded photo:
$file = validate('photo')->file($allowed_mimes)->max(4016053)->required();
• Add $allowed_mimes and $max_file_size constants to the Photo model
• Implement file() and update the max() method in the Validation class
• Fix Validation::clean_value() to properly handle file inputs
⚠️ Missing Validation Messages
• Ensure validation errors are displayed in these views:
• registration.index
• auth.index
• upload.index
💾 File Storage & DB Entry
• Save the uploaded file to the appropriate location
• Create a new photo record in the database
🚫 .gitignore Update
• Add public/photos to the .gitignore file to prevent uploaded files from being committed
⸻
📌 And that completes the upload feature, bringing us to v25-upload-photos. Ready to show off some pictures!
• Hide the notification bell in the top nav if the user isn’t logged in
🧭 Routing & Form Setup
• Create an /upload route
• Set the form’s action and stub in the store() method with a dd($_POST) to start
• Remove the unused “title” field from the upload form
🧪 Validation Process
• Define validation for the uploaded photo:
$file = validate('photo')->file($allowed_mimes)->max(4016053)->required();
• Add $allowed_mimes and $max_file_size constants to the Photo model
• Implement file() and update the max() method in the Validation class
• Fix Validation::clean_value() to properly handle file inputs
⚠️ Missing Validation Messages
• Ensure validation errors are displayed in these views:
• registration.index
• auth.index
• upload.index
💾 File Storage & DB Entry
• Save the uploaded file to the appropriate location
• Create a new photo record in the database
🚫 .gitignore Update
• Add public/photos to the .gitignore file to prevent uploaded files from being committed
⸻
📌 And that completes the upload feature, bringing us to v25-upload-photos. Ready to show off some pictures!
Short Bio:
Bob Cravens is a seasoned technology leader, software architect, and educator with a passion for empowering others through practical, real-world knowledge. As the founder of TekFoundry, Bob has dedicated his career to designing and delivering innovative software solutions that combine cutting-edge technology with elegant simplicity.
At TekCasts, Bob leverages over two decades of experience in software engineering, application architecture, and team leadership to create engaging, high-impact courses for developers and technology professionals. His instructional style is rooted in practical application, offering insights drawn from his extensive background in industries like medical devices and global technology consulting.
Bob’s expertise spans a variety of technologies and methodologies, including PHP/Laravel, FastAPI, and DevOps, as well as architecture best practices and team dynamics. Whether teaching foundational concepts or advanced strategies, he’s passionate about helping others turn complex challenges into streamlined solutions.
When not crafting elegant code or inspiring the next generation of tech innovators, Bob enjoys exploring the intersection of technology, business strategy, and creative problem-solving.
At TekCasts, Bob leverages over two decades of experience in software engineering, application architecture, and team leadership to create engaging, high-impact courses for developers and technology professionals. His instructional style is rooted in practical application, offering insights drawn from his extensive background in industries like medical devices and global technology consulting.
Bob’s expertise spans a variety of technologies and methodologies, including PHP/Laravel, FastAPI, and DevOps, as well as architecture best practices and team dynamics. Whether teaching foundational concepts or advanced strategies, he’s passionate about helping others turn complex challenges into streamlined solutions.
When not crafting elegant code or inspiring the next generation of tech innovators, Bob enjoys exploring the intersection of technology, business strategy, and creative problem-solving.