Dashboard to view your http client requests in laravel application

Overview

Banner

Dashboard to view your http client requests in laravel application

Packagist License Packagist Version GitHub repo size Packagist Downloads

Laravel Blanket is a package with wraps laravel http client requests and provide logs for request and response, also give option to retry any request from dashboard and more...

Desclaimer

This is highly opinionated fun project which provides very simple web interface and log monitoring. If you need advance monitoring tools consider trying Debugbar, Sentry and Bugsnag.

Live Demo

Checkout the demo here to find out more options and feature...

Screenshots

screen shot light screen shot dark

Requirements

  • PHP >= 8.0
  • Laravel >= 8.45

Installation

You can install the package via composer:

composer require ahmadwaleed/laravel-blanket

The package will automatically register a service provider.

After installing Blanket, publish its assets using the blanket:wrap Artisan command.

php artisan blanket:wrap

This package comes with a migration to store all outgoing http client requests. You can publish the migration file using:

php artisan vendor:publish --provider="Ahmadwaleed\Blanket\BlanketServiceProvider" --tag="blanket-migrations"

Run the migrations with:

php artisan migrate

Optionally you can publish the blanket configuration file:

php artisan vendor:publish --provider="Ahmadwaleed\Blanket\BlanketServiceProvider" --tag="blanket-config"

This is the contents of the published config file that will be published as config/blanket.php

return [
/*
    |--------------------------------------------------------------------------
    | Dashboard Enabled
    |--------------------------------------------------------------------------
    |
    | Here you can specify whether to show dashboard or not.
    |
    */

    'enabled' => env('BLANKET_ENABLED', true),

    /*
    |--------------------------------------------------------------------------
    | Blanket Path
    |--------------------------------------------------------------------------
    |
    | This is the URI path where Blanket will be accessible from. Feel free
    | to change this path to anything you like.
    |
    */

    'path' => env('BLANKET_PATH', 'blanket'),

    /*
    |--------------------------------------------------------------------------
    | Blanket Route Middleware
    |--------------------------------------------------------------------------
    |
    | These middleware will be assigned to every Blanket route, giving you
    | the chance to add your own middleware to this list or change any of
    | the existing middleware. Or, you can simply stick with this list.
    |
    */

    'middlewares' => [
        // 'web',
        \Ahmadwaleed\Blanket\Http\Middlewares\Authorize::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | Log Response limit
    |--------------------------------------------------------------------------
    |
    | This is maximum limit blanket is allowed to log response content,
    | if response content exceed this limit the response should be purged.
    | The default limit is 64 KB which is max limit, feel free to set lower limit.
    |
    */

    'log_response_limit' => env('BLANKET_RESPONSE_LIMIT', 64),

    /*
    |--------------------------------------------------------------------------
    | Logs Per Page
    |--------------------------------------------------------------------------
    |
    | How many logs should be fetched per page for dashboard, setting this option
    | to a big number may reduce dashboard performance.
    |
    */

    'logs_per_page' => env('BLANKET_LOGS_PER_PAGE', 100),
];

Credits

License

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

Comments
  • Add built in prune command

    Add built in prune command

    Most packages like this come with some built in way to setup a pruning schedule. Would be nice to have one included as well, currently I'm just deleting older than a week records in a custom job.

    $schedule->command('blanket:prune')->daily(); would be nice! Thanks, very useful package. https://github.com/laravel/telescope/search?q=prune

    opened by iKlsR 2
  • Middlewares Not Working?

    Middlewares Not Working?

    After creating the config file, no matter what I add or change on the middlewares it still functions the same. Even on production mode the same thing happens.

    'middlewares' => ['web','auth.basic'],
    
    opened by jjjrmy 1
  • Update Laravel requirement in composer.json

    Update Laravel requirement in composer.json

    When I installed Laravel Blanket I had v8.21.1 of the Laravel framework.

    The migration failed to run correctly (which I resolved manually), but then after installation it wouldn't log any requests.

    After checking the readme again, I realised that it was because I needed v8.45 of the framework.

    This requirement isn't declared correctly in the composer.json file. If it was, Composer would have told me about the problem.

    Please update the composer.json file to have a minimum requirement of 8.45 on the illuminate/support library.

    opened by mralston 0
  • fix: Fixed a bug causing the blanket route to crash

    fix: Fixed a bug causing the blanket route to crash

    Sometimes urls will return null as their path which was causing the blanket view to stop rendering.

    This pull request causes the path attribute to return '' instead of null, which prevents the type error from being thrown.

    opened by sbrow 0
  • Doesn't seem to work with postgres

    Doesn't seem to work with postgres

    /blanket/logs?take=100&filter_host=&filter_method=all

    SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "`" LINE 1: select count(*) as `all`, count(case when method = 'GET' the... ^ (SQL: select count(*) as `all`, count(case when method = 'GET' then 1 end) as `get`, count(case when method = 'POST' then 1 end) as `post`, count(case when method = 'PUT' then 1 end) as `put`, count(case when method = 'PATCH' then 1 end) as `patch`, count(case when method = 'DELETE' then 1 end) as `delete` from "blanket_logs" limit 1)
    
    bug 
    opened by Johnathan 2
  • Show raw HTTP request and response

    Show raw HTTP request and response

    Outputting the request and response inside a JSON wrapper is useful in that it shows what data was sent, but it isn't a true representation of the raw HTTP request and responses that were transmitted.

    If you're sending a JSON payload to a remote API and the exact format is important (objects vs arrays, etc) then it's difficult to know if what you're seeing in Blanket is exactly what you sent or an interpreted version of it.

    Is it possible to piece the JSON components back together to show what was actually sent in its raw form (like what you'd see if you were using a packet sniffer)?

    You'd show something like this for a request:

    POST /restapi/v1.2/leads HTTP/1.1
    Content-Length: 110
    User-Agent: GuzzleHttp/7
    Content-Type: application/json
    Host: ******
    
    {"key":"******","leads":[{"id":"12345","update":{"status":"sold"}}]}
    

    And this for the response:

    HTTP/1.1 401 Unauthorized
    Date: Tue, 07 Sep 2021 12:41:39 GMT
    Content-Type: text/html;charset=UTF-8
    "Content-Length: 472
    Connection: keep-alive
    Server: Apache
    x-xss-protection: 0
    x-frame-options: SAMEORIGIN
    x-content-type-options: nosniff
    Set-Cookie: PHPSESSID=******; path=/; secure; HttpOnly
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    X-Robots-Tag: noindex
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            <title>401 Unauthorized</title>
        </head>
        <body>
            <h1>Unauthorized</h1>
            <p>You must be authorized to view this page.</p>
            <hr />
            <address>Apache Server at ******</address>
        </body>
    </html>
    
    enhancement 
    opened by mralston 3
Releases(v1.2.0)
Owner
Ahmed waleed
Fullstack LaravelPHP / Javascript / Golang developer, tailwind css lover, trying to be devops.
Ahmed waleed
Laravel Composable View Composers Package - Compose View Composers from Component Composers

Laravel Virtuoso Laravel Composable View Composers Package Increase flexibility and reduce code duplication by easily composing complex View Composers

Yitzchok Willroth 68 Dec 29, 2021
Simple Arabic Laravel Dashboard , has basic settings and a nice layout . to make it easy for you to create fast dashboard

Simple Arabic Laravel Dashboard ✅ Auto Seo ✅ Optimized Notifications With Images ✅ Smart Alerts ✅ Auto Js Validations ✅ Front End Alert ✅ Nice Image V

Peter Tharwat 254 Dec 19, 2022
Execute Laravel Artisan commands via REST APIs and HTTP requests safely.

Artisan Api There might be some times you wanted to execute an Artisan command, but you did not have access to shell or SSH. Here we brought REST API

Alireza 11 Sep 7, 2022
Jetstrap is a lightweight laravel 8 package that focuses on the VIEW side of Jetstream / Breeze package installed in your Laravel application

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.

null 686 Dec 28, 2022
View your Laravel routes on the browser.

View your Laravel routes on the browser. This package adds a route to your Laravel application. Once you've installed this package, enter /route-list

Patompong Savaengsuk 23 Oct 28, 2022
Is an Extension of Laravel View Class which compiles String Template on the fly. It automatically detects changes on your string template and recompiles it if needed.

Laravel-fly-view Is an Extension of Laravel View Class which compiles String Template on the fly. It automatically detects changes on your string temp

John Turingan 16 Jul 17, 2022
Filament-spatie-laravel-activitylog - View your activity logs inside of Filament. ⚡️

View your activity logs inside of Filament. This package provides a Filament resource that shows you all of the activity logs created using the spatie

Ryan Chandler 45 Dec 26, 2022
This package provides a Logs page that allows you to view your Laravel log files in a simple UI

A simplistics log viewer for your Filament apps. This package provides a Logs page that allows you to view your Laravel log files in a simple UI. Inst

Ryan Chandler 9 Sep 17, 2022
Make requests to the Shopify API from your Laravel app

Make requests to the Shopify API from your Laravel app The signifly/laravel-shopify package allows you to easily make requests to the Shopify API. Ins

Signifly 147 Dec 30, 2022
1Pilot.io, a universal dashboard to effortlessly manage all your Laravel applications

Website · Free Trial · Pricing · Documentation · API · Feedback · Support [You] What are you, strange being? [1Pilot] Greetings, traveller. I am 1Pilo

1Pilot 10 Nov 21, 2022
Laravel Logable is a simple way to log http request in your Laravel application.

Laravel Logable is a simple way to log http request in your Laravel application. Requirements php >= 7.4 Laravel version >= 6.0 Installation composer

Sagar 6 Aug 25, 2022
This is a laravel 4 package for the server and client side of datatables at http://datatables.net/

Datatable Important This package will not receive any new updates! You can still use this package, but be preparared that there is no active developme

Nils Plaschke 388 Dec 30, 2022
With dadjokes every time you load your control panel you'll be greeted by an epic dad joke on the dashboard.

Filament Dad Jokes Widget With DadJokes every time you load your control panel you'll be greeted by an epic dad joke on the dashboard. Installation Yo

Craig Smith 15 Jan 7, 2023
Laravel Backup Panel provides a dashboard for spatie/laravel-backup package.

Laravel Backup Panel Laravel Backup Panel provides a dashboard for spatie/laravel-backup package. It lets you: create a backup (full | only database |

Pavel Mironchik 366 Dec 6, 2022
A simple `make:view` command for Laravel applications.

A simple make:view command for Laravel applications. Quickly generate a new Blade view from the console using artisan make:view. Installation You can

Ryan Chandler 10 Oct 17, 2022
Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology.

Stash View Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology. What is Russian Doll Caching ? It i

Bhushan Gaikwad 18 Nov 20, 2022
27Laracurl Laravel wrapper package for PHP cURL class that provides OOP interface to cURL. [10/27/2015] View Details

Laracurl Laravel cURL Wrapper for Andreas Lutro's OOP cURL Class Installation To install the package, simply add the following to your Laravel install

zjango 8 Sep 9, 2018
View template engine of PHP extracted from Laravel

Blade 【简体中文】 This is a view templating engine which is extracted from Laravel. It's independent without relying on Laravel's Container or any others.

Scholer 143 Dec 13, 2022
A package that adds view-composer like feature to Inertia.js Laravel adapter

Kinetic A package that adds view-composer like feature to Inertia.js Laravel adapter. Use to be able to share props based on the Inertia component nam

Marvin Quezon 76 Dec 12, 2022