Open djfrailey opened 4 years ago
The referenced block of code could be cleaned up with the use of Laravel's API Resources.
https://github.com/TobiasLounsbury/EmpireSkillTest/blob/9bebb5ebaa5bbde267e03a2ec544b28af9f9c286/app/Http/Controllers/GameController.php#L27-L33
https://laravel.com/docs/5.8/eloquent-resources
EDIT: Added link to code since GitHub didn't carry it over for me 🤷♂
Thanks for the link. I was unaware of this pattern and you are correct that it is a great way to clean up that block. I'll read the full documentation for resources when I have time.
The referenced block of code could be cleaned up with the use of Laravel's API Resources.
https://github.com/TobiasLounsbury/EmpireSkillTest/blob/9bebb5ebaa5bbde267e03a2ec544b28af9f9c286/app/Http/Controllers/GameController.php#L27-L33
https://laravel.com/docs/5.8/eloquent-resources
EDIT: Added link to code since GitHub didn't carry it over for me 🤷♂