Support the ongoing development of Laravel.io →
posted 8 years ago
Packages
Last updated 2 years ago.
0

I took a quick look and maybe a couple suggestions.

I do not generally do this but it is something that I should and is a good suggestion. Coding style, take a look at how Laravel maintains readable code. Simple example, https://github.com/laravel/laravel/blob/master/app/Providers/AuthServiceProvider.php they have spacing, doc blocks, etc - that make the code all very readable and provides some documentation at the same time.

Maybe changing these functions to use the config/default message instead of a hard-coded function default, might be something to look at.

https://github.com/Anshdesire/ApiResponse/blob/master/src/ApiResponse.php#L148

    public function respondNotFound($message = "Resource not found!")
    {
        return $this->setStatusCode($this->STATUS_CODE[404])->respondWithError($message);
    }
    public function respondInternalError($message = "Internal server error")
    {
        return $this->setStatusCode($this->STATUS_CODE[500])->respond([],$message,[]);
    }

I did not see anything else in my quick look, but i do see how the package will be useful. I might end up using this in a project later, so that I do not have to reinvent the wheel.

Hope that helps :)

0

Thank you so much porter and you can point right there also :) I have followed all your points and will release it soon.

:)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Anshdesire anshdesire Joined 20 Apr 2016

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.