Open ml-milan-vit opened 4 years ago
Final score:
Thank you so much for your efforts! I hope the project was as fun for you to make as it was for me to review.
I think there are things that could be improved, both from a stylistic point of view, as well as the architectural point of view. In many places, the code felt cluttered, or it felt like it doesn’t belong to the place in which it is currently present. In other places, a simply duplicated/copy-pasted code was found.
Please don’t misunderstand me, I think this was a valiant first step in the wonderful world of Laravel (and a dreadful world of PHP 🤣), but there are definitely things that I’d wish to see improved. May I recommend watching tutorials at Laracasts website, as well as perhaps looking at other projects that were parts of this study program? Getting inspired by one another is a wonderful thing, after all 🤩
Hi @ml-milan-vit , thanks for reviewing our project. I've learned many things just from reading your review. Your insights are much appreciated, and I laughed when I saw your meme. Have a good day!
Hello, thank you so much for your efforts! 👏
Throughout the day, I’ll be going through the code repository and gathering my thoughts here. For the record, I was going through the
master
branch as that one seems to contain the most recent commits. The final score will be issued after evaluating projects from other groups, to keep the excitement in the air 🤣Good points:
FormRequests
are used to validate incoming requests? Nice de-composition of logic 🧠👌Interesting points:
$this->hasMany('App\Service');
, you can also write$this->hasMany(Service::class);
, provided that you import the relevant class? I like that approach more, it eliminates string-typing and possibly allows IDEs and editors to make smarter suggestionsAuthController
, FYI. I guess the best I can describe it is with an image, but I’m really sorry for not being able to explain better:UserController:L58-60
is somewhat amusing 😅Bad points:
welcome
template is still present both as a template file, and as a route. That doesn’t seem to be necessary 🤔ServiceController:L30
UserController:L36
or:L47
should be needed – you should be able to get the correct entity just by using route model binding, shouldn’t you? And it should also fail for you automatically if the entity doesn’t exist unless some misconfiguration happened.$fillable
should do the job. In more complex cases, additional methods on models should be implemented, rather than cluttering controllers with unnecessary code.ServiceController::getServicesByDate
,::getServicesByCategory
and::searchServicesByKeyword
, among others. I would probably not go for repositories for a project of this size, but I’d at least put this into models, if not somewhere else.