How Do I
It's cool, we all hit road blocks from time to time. Have a web-related question that could be solved in ten minutes or less as a video? If so, tweet @laracasts, hash #helpMeLaracasts, and cross your fingers! You just might see your answer in this series.
Series episodes
How Do I Restrict Access With Nginx
4m 21sLearn how to restrict website access at the server level using Nginx. Protect your site before launch with simple, effective server rules. Start now!
How Do I Distribute an NPM Package Written With ES2015
5m 44sLearn how to build and distribute an ES2015 NPM package with modern features, compiling it for seamless use by all your users. Start coding smarter!
How Do I Use Iterators
17m 7sLearn how to use iterators to loop over arrays, collections, and more. Simplify complex data traversal with this friendly, easy-to-follow Laravel lesson.
How Should I Name My Events and Listeners?
13m 23sLearn smart event and listener naming in Laravel! Discover a clear, natural approach to naming without unnecessary suffixes in this friendly guide.
How Do I Unit Test Eloquent Models?
14m 48sDiscover why you shouldn't unit test Eloquent models directly and learn practical testing strategies in this clear, friendly Laravel tutorial.
Help Me Understand CSRF
21m 51sUnderstand CSRF protection in Laravel—learn how csrf_field() works and why safeguarding your app from attacks is essential and easy.
How Do I Fetch the Most Recent Reply's Username
11m 17sLearn how to fetch the most recent comment's username in Laravel using relationships, joins, and clean, effective query techniques.
Help Me Understand When to Use Polymorphic Relations
24m 10sDiscover when and how to use Laravel polymorphic relations—clear, friendly guidance to master this tricky database feature with confidence.
How Do I Create Nested Comments
27m 44sLearn to create nested comments like Reddit or Disqus using Eloquent and collections—boost your Laravel skills with practical, daily workflow techniques.
How Do I Sort Tags By Letter
19m 11sLearn to sort and display tags by letter using Bulma, CSS columns, and Eloquent collections for a clean, organized tag page.
How Do I Dry Up My Forms
15m 42sLearn how to DRY up your forms by reusing create and edit views with dynamic inputs and buttons. Simplify form handling in this practical tutorial!
How Do I Automatically Resize Textareas to Fit Their Contents
3m 26sLearn how to auto-resize textareas to fit content using the easy autosize package. Improve user experience with dynamic, hassle-free inputs!
How Do I Create A Snippets App: Part 1
18m 59sBuild a Laravel 5.4 snippets app from scratch! Learn to create, fork, and track code snippets in this friendly, step-by-step tutorial.
How Do I Create A Snippets App: Part 2
11m 33sLearn to fork snippets, add syntax highlighting with highlight.js, and finish your app in this hands-on, step-by-step coding tutorial.
How Do I Convert Switch Statements to Polymorphism
11mLearn how to replace messy switch statements with clean polymorphism and factories for better, maintainable PHP code. Watch this Laracasts tutorial!
How Do I Reference Objects Like Arrays
4m 31sLearn how to make PHP objects behave like arrays by implementing ArrayAccess—simplify data handling in this clear Laracasts tutorial.
How Do I Impersonate Users
11m 47sLearn how to safely impersonate users in your app to debug issues as they see them—secure, test, and implement this powerful feature in Laracasts.
How to Cleanly Refactor Loops
13m 2sMaster clean loop refactoring with collection techniques—boost readability and write elegant, maintainable code step by step!
How Do I Make One Interface Fit Another
7m 29sLearn how to adapt one interface to fit another using the adapter pattern—solve common coding challenges with clean, flexible design!
Contribute to Laravel: From Start to PR
8m 57sLearn how to contribute to Laravel: find a patch, apply changes, test, and submit your first pull request with confidence and ease!
How Do I Create Laravel Macros
12m 49sLearn how to create Laravel macros to dynamically extend classes. Dive into the Macroable trait and see how this powerful feature works behind the scenes!
How Do I Create a Star-Rating System: Part 1
19m 21sStart building a star-rating system by creating a backend API that tracks user scores and calculates average ratings. Follow along step-by-step!
How Do I Create a Star-Rating System: Part 2
9m 7sLearn how to update an article’s average rating with HTTP requests in this step-by-step guide to building a star-rating system from the outside in.
How Do I Create a Star-Rating System: Part 3
15m 54sBuild a dynamic Vue star-rating component that sends AJAX ratings to your server. Learn to create interactive, real-time feedback in this step-by-step guide!
How Do I Make a Floating Nav Bar
10m 45sLearn how to create a smooth floating nav bar using JavaScript’s IntersectionObserver API—keep your navigation visible and engaging as users scroll your page!




