{"repo":"imanghafoori1/laravel-terminator","free":true,"listed":false,"github":"https://github.com/imanghafoori1/laravel-terminator","clone":"git clone https://github.com/imanghafoori1/laravel-terminator.git","description":"A package to help you clean up your controllers in laravel","language":"PHP","stars":254,"topics":["laravel","laravel-package","refactor","refactoring-tools"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"# :fire:Laravel Terminator :fire: :gem: \"Tell, don't ask principle\" for your laravel controllers What this package is good for? Short answer : This package helps you clean up your controller code in a way that you have never seen before Made with :heart: for every laravel \"Clean Coder\" Installation: composer require imanghafoori/laravel-terminator No need to add any service providers. Compatibility: - Laravel +5.1 and above - Php 7.0 and above When to use it? Code smell: :nose: - When you see that you have an endpoint from which you have to send back more than one type of response... Then this package is going to help you a lot. Example: Consider a typical login endpoint, It may return 5 type of responses in different cases: - 1- User is already logged in, so redirect. - 2- Successfull login - 3- Invalid credentials error - 4- Incorrect credentials error - 5- Too many login attempts error The fact that MVC frameworks force us to \"return a response\" from controllers prevents us from simplify controllers beyond a certain point. So we decide to break that jail and bring ourselves freedom. The idea is : Any class in the application should be able to send back a response. Remember: Controllers Are Controllers, They Are Not Responders!!! Controllers, \"control\" the execution flow of your code, and send commands to other objects, telling them what to do. Their responsibility is not returning a \"response\" back to the client and this is the philosophy of terminator package. Consider th","default_branch":null,"files":null,"tree":[],"storefront":"/r/imanghafoori1","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/imanghafoori1/laravel-terminator/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}