Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Useful Packages

Premium
4 min read

In this last lesson, let's check four packages that could be useful when working with APIs.


1. Laravel API Response Helpers

The first package, Laravel API Response Helpers, helps you to standardize responses.

If you return a lot of return response()->json(), this package might help you. We can install this package via composer.

composer require f9webltd/laravel-api-response-helpers

Then, add trait F9Web\ApiResponseHelpers to any Controller you want to use helpers. Now, we can use helpers from the package. For example, return a successful response:

use F9Web\ApiResponseHelpers;
 
class ProductController extends Controller
{
ApiResponseHelpers;
 
public function index()
{
$products = Product::with('category')->paginate(9);
 
return responseWithSuccess($products);
}
}

You can check other helper methods in the official documentation.

You can watch the video version of the package review on YouTube: Laravel Package For Standard API Responses.

The Full Lesson is Only for Premium Members

Want to access all of our courses? (31 h 16 min)

You also get:

55 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

No comments yet…