کد هیولاگونه را مرتب کن
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.
قسمتهای دوره
از شیءهای فرم استفاده کنید
19m 39sLearn how form objects manage validation, authorization, and persistence. Build one from scratch and explore Laravel’s form request classes.
از کیسهای استفاده (Use Cases) استفاده کنید
13m 11sExplore how applying use case thinking directly in code can clarify user interactions and improve your system’s design and functionality.
از رویدادهای دامنه استفاده کنید
16m 18sExplore how using domain events and listeners can help you build complex, maintainable functionality in your application with ease.
تمیز کردن شیء خداگونه ۱: عبوردهی (Pass-Through)
4m 45sTame your God User object by extracting related methods into dedicated objects. Learn pass-through techniques for cleaner, maintainable code.
تمیز کردن شیء خداگونه ۲: تریتها و جورابها
7m 59sClean up bulky God objects by extracting traits. Learn how organizing code like sorting socks leads to cleaner, more maintainable classes.
تمیز کردن شیء خداگونه ۳: اشیای مقداری (Value Objects)
9m 19sClean up messy classes by extracting value objects wisely. Learn when and how to refactor for cleaner, maintainable code in this Laracasts lesson.
از سیاستها (Policies) استفاده کنید
16m 32sSimplify complex authorization by using policy objects in Laravel—reuse named logic for cleaner, more maintainable controller code.
تقسیم وظایف به مراحل را در نظر بگیرید
11m 31sLearn how to break complex tasks into manageable steps by extracting each into its own class for cleaner, more maintainable code.
استراتژیسازی را در نظر بگیرید
12m 29sDiscover how to simplify complex conditional logic using strategies for cleaner, more maintainable code in real-world Laravel applications.
نرمالسازی را در نظر بگیرید
15m 29sLearn how to clean up messy code by normalizing values with smart refactors, extracting logic for clearer, maintainable, and flexible workflows.
از مدلهای نمایش (View Models) استفاده کنید
11m 5sLearn how to simplify repeated view logic by creating reusable view models in this friendly, practical Laracasts tutorial!
پارامترهای زیاد متد نشانهای است
8m 52sLearn why methods with many parameters signal a design issue and how to spot opportunities for cleaner, smarter code in this friendly Laracasts lesson!
تزیین (Decorating) را در نظر بگیرید
9m 4sLearn how to clean up code by adding dynamic behavior with decorators in this easy, friendly Laracasts tutorial—boost your coding skills today!
اینترفیسهای روان (Fluent) را در نظر بگیرید
10m 3sDiscover the power of fluent interfaces with clear examples and practical tips in this friendly, engaging Laracasts tutorial!
بازنویسی عملی
18m 18sApply proven refactoring techniques to real code in this hands-on Laracasts lesson—boost your skills with practical, friendly guidance!
پایبندی به هفت متد منبعدار
14m 42sKeep your Laravel controllers clean and efficient! Learn how to split bloated resourceful controllers into focused, manageable ones.
از اشیای کوئری (Query Objects) استفاده کنید
4m 12sSimplify complex Eloquent queries by using query objects—keep controllers clean and your Laravel code organized with easy, reusable classes.
بازنویسی ویوهای خود را در نظر بگیرید
12m 49sRefactor your views like PHP classes—learn clean, organized template techniques to improve readability and maintainability in your projects.
یک کلاس کاربر مهمان در نظر بگیرید
9m 3sSimplify user checks in your views by creating a Guest User class—clean up your code and handle signed-in logic with ease.
جمعبندی را در نظر بگیرید
8mLearn to wrap API JSON responses in simple POPO classes to cleanly add behavior and formatting—keep your views and helpers tidy.




