-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for laravel 7 and 8 #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @lakuapik. I want to discuss something
- I think
php-cs-fixer
didn't work properly. Check my comments. - how about laravel 5 and 6? it is possible to support them?
- Should we include documentation how to customize response structure? I think we need to mention
toResponse
method part
@axmad386 i run ❯ date; git branch --show-current; composer test
Mon Jun 13 10:58:00 AM WIB 2022
support-laravel-7-and-8
> php-cs-fixer fix --allow-risky=yes
Loaded config default from "/media/d/data/work/labs/laravel-api-response/.php-cs-fixer.php".
Using cache file ".php-cs-fixer.cache".
Fixed all files in 0.006 seconds, 16.000 MB memory used
> pest --stop-on-failure
PASS Tests\ApiExceptionTest
✓ it can handle ApiException
✓ it returns HTTP_BAD_REQUEST for ApiException by default
✓ it can handle ApiValidationException
✓ it can access route with validated parameters
PASS Tests\ApiResponseTest
✓ it returns correct response header
✓ it returns correct json structure for success api response
✓ it returns correct json structure for error api response
✓ it fails when the argument $data is not valid
✓ it fails when the argument $errors is not valid
Tests: 9 passed
Time: 0.41s Off course we could also support laravel 5 and 6, but we need to ditch pestphp and move to phpunit. pest require minimum version of php 7.3. which is doable for laravel 7. for laravel 5 and 6, it can run below 7.3. |
Oh I see. Then it's better to exclude laravel 5 and 6 for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is ok, let's merge this to the main branch
This PR not just adding support for laravel 7 and 8, but also refactoring the core and improve documentation.
@axmad386 please kindly review and discuss features here.