PHP For Beginners
We all start somewhere. For programming, this series is that first step. I've designed it specifically for newcomers to, not just PHP, but programming in general. Here, you'll learn the fundamentals of PHP - all the way down to defining basic variables and arrays.
Think of this series as a key stepping stone for your programming journey.
Series episodes
The Fundamentals (11)
How to Choose a Programming Language
1m 21sWondering which programming language to learn first? Discover why PHP stands out and how to make the best choice for your coding journey in this friendly Laracasts guide!
Tools of the Trade
8m 37sGet set up for success! Learn which essential tools to install and how to prepare your environment in this friendly, step-by-step Laracasts episode.
Your First PHP Tag
8m 9sStart your PHP journey! Learn how to set up basic HTML, launch a PHP server, and view your first PHP tag in the browser with this friendly Laracasts lesson.
Variables
7m 18sDiscover the power of variables and basic concatenation! Learn why variables matter and how to use them effectively in this friendly Laracasts lesson.
Conditionals and Booleans
11m 6sBuild a dynamic webpage using conditionals and booleans! Learn how to display messages based on user actions in this friendly, hands-on Laracasts lesson.
Arrays
8m 37sLearn how to use arrays to store and manage lists like usernames or book titles. This friendly Laracasts lesson helps you organize data with ease!
Associative Arrays
7m 19sMaster associative arrays in PHP! Learn how to access items by key and organize data efficiently in this friendly, hands-on Laracasts lesson.
Functions and Filters
12m 20sCongrats on your progress! Dive into functions—the verbs of programming—and learn how to use them effectively in this engaging Laracasts lesson.
Lambda Functions
12m 8sDive into lambda functions in this Laracasts episode! Learn what they are, when to use them, and how they can simplify your PHP code with smart refactors.
Separate Logic From the Template
8m 35sLearn why separating PHP logic from HTML boosts code clarity and maintainability. Join this Laracasts lesson to organize your projects like a pro!
Technical Check-in #1 (With Exam)
4m 53sTest your PHP skills with this quick Laracasts check-in and quiz. Reinforce what you've learned before moving on to the next exciting section!
Dynamic Web Applications (9)
Page Links
11m 1sLearn to build a real PHP app with MySQL in this friendly Laracasts tutorial. Move beyond basics and create dynamic, database-driven projects with ease!
PHP Partials
9m 10sStop duplicating HTML, use PHP partials to build reusable view components for cleaner, faster, and more maintainable templates.
Superglobals and Current Page Styling
12m 57sUse PHP's $_SERVER superglobal to detect the current page and apply dynamic styles or logic-simple, practical examples for real projects.
Make a PHP Router
18m 2sBuild a custom PHP router from scratch, learn routing, response codes, and clean code organization to power your lightweight apps.
Create a MySQL Database
6m 10sConnect to MySQL and create a database and table—step-by-step setup to prepare your project for PHP database interaction.
PDO First Steps
14m 24sLearn how to connect PHP to MySQL and run secure SELECT queries with PDO, step-by-step basics for safe database access.
Extract a PHP Database Class
10m 34sExtract a PHP Database class to encapsulate PDO initialization and prepared queries, improving clarity, reuse, and testability.
Environments and Configuration Flexibility
12m 59sMake your app configurable: replace hard-coded database settings with flexible environment-based configuration for safe production deployments.
SQL Injection Vulnerabilities Explained
10m 56sLearn SQL injection through real examples, discover why web input must be treated as untrusted, and how to prevent vulnerable queries.
Notes Mini-Project (8)
Database Tables and Indexes
7m 52sStart a mini notes app: design initial database and learn MySQL indexes with clear, practical steps to power fast queries.
Render the Notes and Note Page
14m 27sBuild a notes index and individual note pages from your initial database—learn step-by-step rendering to display John Doe's notes cleanly.
Introduction to Authorization
14m 27sLearn how to secure your app with proper authorization, handle status codes, and avoid magic numbers in this clear, practical Laracasts lesson.
Programming is Rewriting
12m 17sRefactor your code and learn best practices for wrapping external APIs before building forms to save notes in this practical, friendly Laracasts lesson.
Intro to Forms and Request Methods
18m 6sLearn how to submit forms using different request methods and detect POST submissions in your controller in this clear, practical Laracasts lesson.
Always Escape Untrusted Input
8m 21sLearn how to securely save user input by always escaping untrusted data to protect your app from vulnerabilities in this practical Laracasts lesson.
Intro to Form Validation
12m 50sLearn how to master form validation with browser and server-side techniques to ensure accurate, secure user data submission in this friendly Laracasts lesson.
Extract a Simple Validator Class
11m 43sExtract a simple Validator class to centralize validation rules, boost readability, and make form checks reusable and flexible.
Project Organization (8)
Resourceful Naming Conventions
6m 36sAdopt resourceful naming conventions to organize code, improve clarity, and streamline development with practical, consistent patterns.
PHP Autoloading and Extraction
19m 36sMaster PHP project organization: document roots, helpers, constants, autoloading and extraction techniques to structure maintainable apps.
Namespacing: What, Why, How?
12m 8sMaster PHP namespacing: what it is, why it matters, and how to use it—explained clearly with a simple music-collection analogy.
Handle Multiple Request Methods From a Controller Action?
12m 11sTackle messy controller actions that handle multiple request methods, see a real example and prepare for refactors to simplify and clean up code.
Build a Better Router
20m 45sBuild a smarter router that handles all form request types using hidden inputs to spoof methods. Enhance your app’s flexibility and control with this guide!
One Request, One Controller
7m 7sLearn how to refactor controllers for focused actions using improved routing. Keep your code clean and simple while handling multiple form request types efficiently.
Make Your First Service Container
19m 22sLearn how to create your first service container to organize code and automate dependency management, making your Laravel apps cleaner and more efficient.
Updating With PATCH Requests
21m 14sLearn how to update resources using PATCH requests—create forms, routes, and controllers to efficiently edit notes in your Laravel application!
Sessions and Authentication (5)
PHP Sessions 101
13m 56sDive into PHP sessions and learn how to persist data across requests—master session basics to build dynamic, stateful web applications with ease!
Register a New User
18m 59sCreate a PHP registration form, add new users to the database, and update sessions to mark them signed in—practical, secure walkthrough.
Introduction to Middleware
22m 4sLearn middleware in Laravel: bridge requests and app core, build guest and auth middleware classes to control route access step-by-step.
Manage Passwords Like This For The Remainder of Your Career
4m 49sLearn why password hashing is vital and how to secure user data with Bcrypt. Protect passwords effectively and boost your app’s security in this essential episode!
Log In and Log Out
25m 45sBuild a complete login and logout system with clear, step-by-step guidance. Master user authentication and handle tricky logout steps with confidence in this episode!
Refactoring Techniques (5)
Extract a Form Validation Object
13m 28sRefactor your login form by extracting a validation object to keep controllers clean, clear, and reusable. Learn this essential Laravel technique now!
Extract an Authenticator Class
13m 21sExtract an Authenticator class to clean up your controller, centralize authentication logic, and improve clarity and testability.
The PRG Pattern (and Session Flashing)
21m 17sLearn the PRG (Post-Redirect-Get) pattern and session flashing to prevent duplicate form submissions, improve UX, and simplify error handling.
Flash Old Form Data to the Session
5m 57sFlash old form data to session and display previous input to users - preserve input after redirects for smoother form UX.
Automatically Redirect Back Upon Failed Validation
26m 7sAutomatically redirect users back after failed form validation to reduce controller duplication, preserve input, and simplify error handling.
Meet Composer (2)
Composer and Free Autoloading
13m 12sLearn Composer's dependency management and powerful autoloader to install libraries, manage packages, and streamline PHP project setup.
Install Two Composer Packages: Collections and PestPHP
15m 35sInstall Collections and PestPHP with Composer: step-by-step guide to add two packages and boost testing and utilities.




