Browse all series
TechniquesAdvanced20 episodes

Whip Monstrous Code Into Shape

You did your best, but somehow that User object, over time, morphed into a monstrous God object. And your controllers started out nice and clean, but now... not so much.

We've all been there. In this series, we'll review a number of ideas for whipping convoluted code into shape.

Series episodes

Consider Form Objects

19m 39s

Learn how form objects manage validation, authorization, and persistence. Build one from scratch and explore Laravel’s form request classes.

Consider Use Cases

13m 11s

Explore how applying use case thinking directly in code can clarify user interactions and improve your system’s design and functionality.

Consider Domain Events

16m 18s

Explore how using domain events and listeners can help you build complex, maintainable functionality in your application with ease.

God Object Cleanup #1: Pass-Through

4m 45s

Tame your God User object by extracting related methods into dedicated objects. Learn pass-through techniques for cleaner, maintainable code.

God Object Cleanup #2: Traits and Socks

7m 59s

Clean up bulky God objects by extracting traits. Learn how organizing code like sorting socks leads to cleaner, more maintainable classes.

God Object Cleanup #3: Value Objects

9m 19s

Clean up messy classes by extracting value objects wisely. Learn when and how to refactor for cleaner, maintainable code in this Laracasts lesson.

Consider Policies

16m 32s

Simplify complex authorization by using policy objects in Laravel—reuse named logic for cleaner, more maintainable controller code.

Consider Splitting Tasks into Steps

11m 31s

Learn how to break complex tasks into manageable steps by extracting each into its own class for cleaner, more maintainable code.

Consider Strategizing

12m 29s

Discover how to simplify complex conditional logic using strategies for cleaner, more maintainable code in real-world Laravel applications.

Consider Normalizing

15m 29s

Learn how to clean up messy code by normalizing values with smart refactors, extracting logic for clearer, maintainable, and flexible workflows.

Consider View Models

11m 5s

Learn how to simplify repeated view logic by creating reusable view models in this friendly, practical Laracasts tutorial!

Too Many Method Parameters is a Sign

8m 52s

Learn why methods with many parameters signal a design issue and how to spot opportunities for cleaner, smarter code in this friendly Laracasts lesson!

Consider Decorating

9m 4s

Learn how to clean up code by adding dynamic behavior with decorators in this easy, friendly Laracasts tutorial—boost your coding skills today!

Consider Fluent Interfaces

10m 3s

Discover the power of fluent interfaces with clear examples and practical tips in this friendly, engaging Laracasts tutorial!

Hands On Refactoring

18m 18s

Apply proven refactoring techniques to real code in this hands-on Laracasts lesson—boost your skills with practical, friendly guidance!

Staying True to the Seven Resourceful Methods

14m 42s

Keep your Laravel controllers clean and efficient! Learn how to split bloated resourceful controllers into focused, manageable ones.

Consider Query Objects

4m 12s

Simplify complex Eloquent queries by using query objects—keep controllers clean and your Laravel code organized with easy, reusable classes.

Consider Refactoring Your Views

12m 49s

Refactor your views like PHP classes—learn clean, organized template techniques to improve readability and maintainability in your projects.

Consider a Guest User Class

9m 3s

Simplify user checks in your views by creating a Guest User class—clean up your code and handle signed-in logic with ease.

Consider Wrapping it Up

8m

Learn to wrap API JSON responses in simple POPO classes to cleanly add behavior and formatting—keep your views and helpers tidy.

Continue learning

Thumbnail for 10 Techniques for Cleaner Code
10 Techniques for Cleaner Code

With Jeffrey Way

  • 10 episodes
  • Intermediate
  • Techniques
Thumbnail for What's New in Laravel 5.7
What's New in Laravel 5.7

With Jeffrey Way

  • 4 episodes
  • Intermediate
  • Frameworks
Thumbnail for What's New in Laravel 5.4
What's New in Laravel 5.4

With Jeffrey Way

  • 10 episodes
  • Intermediate
  • Frameworks
Thumbnail for Laravel Authentication Techniques
Laravel Authentication Techniques

With Jeffrey Way

  • 2 episodes
  • Intermediate
  • Techniques
Thumbnail for What's New in Laravel 5.8
What's New in Laravel 5.8

With Jeffrey Way

  • 5 episodes
  • Beginner
  • Frameworks

Would you like to hear from Laracasts by email occasionally?