Support the ongoing development of Laravel.io →
Session Eloquent Architecture
Last updated 2 years ago.
0

thepsion5 said:

The goal that I post some "ugly" Laravel code and we, as a community, discuss the best ways to go about cleaning it up, making it more readable, testable, etc.

I'm going to request you make this open to not just you posting, but other members. Otherwise it kinda feels like you're pretty much just trying to get people to refactor your code for free.

Last updated 2 years ago.
0

machuga said:

thepsion5 said:

The goal that I post some "ugly" Laravel code and we, as a community, discuss the best ways to go about cleaning it up, making it more readable, testable, etc.

I'm going to request you make this open to not just you posting, but other members. Otherwise it kinda feels like you're pretty much just trying to get people to refactor your code for free.

I assumed a section called "Submission Rules" would imply that the whole idea is to accept other people's code. ;)

Last updated 2 years ago.
0

Why just the controller file? Push the entire framework with migrations, seeds, routes, models... How can I test if my refactors actually work with just this?

And that way everyone would have the same starting point to work off of. Make a simple working example with all the code stuffed in a controller or two.

Last updated 2 years ago.
0

pogachar said:

Why just the controller file? Push the entire framework with migrations, seeds, routes, models... How can I test if my refactors actually work with just this?

And that way everyone would have the same starting point to work off of. Make a simple working example with all the code stuffed in a controller or two.

Two reasons:

  1. I didn't want to increase the barrier of entry by requiring people to install the entire framework, run migrations, etc

  2. I assumed people would be far less comfortable submitting their entire codebase as opposed to a few files. Where I've worked, at least, that would be grounds for getting fired as all our code is proprietary

Last updated 2 years ago.
0

I've just submitted my solution, and would welcome discussion/comment/criticism. You can see it here: https://github.com/thepsion5/refactoring-exercise-1/tree/author-solution

The other submitted solutions (well, solution...) can be found here: https://github.com/thepsion5/refactoring-exercise-1/pulls

How do you all believe those particular solutions measure up? What would you do instead?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

thepsion5 thepsion5 Joined 3 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.