New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

sarahman/laravel-http-request-api-log

This library stores the http request api log into a database table.
16,554 1

Larablocks Analysis

sarahman/laravel-http-request-api-log works with Laravel 4 to 11 (latest release 1.0.3, Mar 25, 2024), all past end of life (the last on Mar 12, 2026): no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 4 to 11, past end of life since Mar 12, 2026
  • No release in the last 12 months (last: Mar 25, 2024)
  • 554 downloads a month (needs 10,000)
  • 1 GitHub star (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Mar 25, 2024.
  • No releases in the last 12 months.
  • First released: Sep 3, 2023.
  • Monthly downloads: 554, up 36% from six months ago.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require sarahman/laravel-http-request-api-log
Latest Version:1.0.3
PHP:>=5.5
Laravel:4 – 11
License:MIT
Last Updated:Mar 25, 2024
Links: GitHub  ·  Packagist
Maintainer: sarahman

API Log Activity inside Laravel Application

Latest Version on Packagist Build Status Scrutinizer Code Quality StyleCI Total Downloads License PHP Version Require

The sarahman/laravel-http-request-api-log package provides easy to use functionality to log the http api logs in the Laravel application. All the api logs will be stored in the _api_calls table.

You can retrieve all api logs using the Sarahman\HttpRequestApiLog\Models\ApiLog model.

ApiLog::all();

Here's a more advanced example:

...
use GuzzleHttp\Psr7\Response;
use Illuminate\Database\Eloquent\Model;
use Sarahman\HttpRequestApiLog\Traits\WritesHttpLogs;

class ApiClient
{
    use WritesHttpLogs;
    ...
    ...
    public function __construct()
    {
        ...
        ...
        $this->enableLogging = false; // Overwrite the logging functionality being enabled or not.
    }
    ...
    ...
    public function sampleMethod()
    {
        ...
        ...
        $this->log('POST', $url, $options, new Response(200));
    }
}

Installation

You can install the package via composer:

composer require sarahman/laravel-http-request-api-log

Next, you need to load the service provider:

// app/config/app.php
'providers' => [
    ...
    Sarahman\HttpRequestApiLog\HttpRequestApiLogServiceProvider::class,
];

You can publish the config file with:

php artisan config:publish sarahman/laravel-http-request-api-log

This is the contents of the published config file:

return [
    /*
     * If set to false, no api log will be saved to the database.
     */
    'enabled' => true,

    /*
     * This model will be used to log activity.
     * It should extend Illuminate\Database\Eloquent\Model.
     */
    'api_log_model' => \Sarahman\HttpRequestApiLog\Models\ApiLog::class,

    /*
     * This is the database connection that will be used by the migration and
     * the ApiLog model shipped with this package. In case it's not set
     * Laravel's database.default will be used instead.
     */
    'database_connection' => 'mysql',

    /*
     * This is the name of the table that will be created by the migration and
     * used by the ApiLog model shipped with this package.
     */
    'table_name' => '_api_calls',
];

You can also publish the migration with:

php artisan migrate:publish sarahman/laravel-http-request-api-log

Now, you can create the _api_calls table by running the migrations:

php artisan migrate

N.B.: You can disable the api logging to a specific api client using the enableLogging property setting as false.

Testing

You might go to the project directory and run the following command to run test code.

composer test

Contribution

Feel free to contribute in this library. Please make your changes and send us pull requests.

Security Issues

If you discover any security related issues, please feel free to create an issue in the issue tracker or write us at aabid048@gmail.com.

License

The MIT License (MIT). Please see License File for more information.

Related Packages

sarahman/guzzle-client-trait

This package is intended to handle guzzle client creation, its api calls & their...

5,055 0
chhw/form-request

This package can use form request just as Laravel do.

312 2
fireguard/lumen-api

Basic API Implementing with Lumen.

4 2
zharletc/microapirequest

zharletc - Microapi-Request

169 0
oxid-community/oxid-rest-api

REST API for OXID eShop based on Laravel Lumen Framework.

94 4

Version History

Version Released PHP Laravel License
1.0.3 >=5.5 >=4.0 MIT
1.0.2 >=5.5 >=4.0 MIT
1.0.1 >=5.5 ^4.0 MIT
1.0.0 >=5.5 ^4.0 MIT