This video will be available to
subscribers on Tue, Jun 24, 2025.
You must be a subscriber to view this video.
Jun 24, 2025
20m:42s

User Registration

Classification
Software Engineering | Languages | PHP
Keywords
oop | php

About This Episode:

🔹 Controller Setup
- Create a new RegistrationController inside Http/, with index() and store() methods
- index() displays the registration form
- store() temporarily calls dd($_POST) to confirm input

🔹 View
- Add the form view at views/registration.index.view.php

🔹 Validation
- Write validation rules in fluent style:
- $email = validate('email')->email()->required()->unique('users', 'email');
- Build out the validation logic to support this pattern

🔹 User Model
- Create a Models/User class
- Move relevant DB logic from the controller into the model

🔹 Model Base Enhancements
- In the Model base class:
- Add $is_count to build_query()
- Implement a count() method that supports basic tallying
- In the Database class:
- Add a count() method to execute counting queries
- Add a unique() validation method using model and count

🔹 Data Insertion
- Assemble a $data array with validated inputs
- Call User::insert($data) to create the new user

That’ll wrap up the registration feature and land us at v22-registering-users 🏁
Bob Cravens

Bob Cravens

Your Instructor
more »
Owner
TekFoundry
Wisconsin
United States
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.