Download the PHP package soyhuce/dev-tools without Composer

On this page you can find all versions of the php package soyhuce/dev-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dev-tools

Dev Tools

Tools for Laravel development

Latest Version on Packagist Total Downloads

Installation

You can install the package via composer:

Laravel will discover the service provider Soyhuce\DevTools\ServiceProvider.

After installing Dev Tools, publish its assets using:

You can also add the facade to your alias in config\app.php :

Available tools

Debug

When activated, it allows logging some information on request execution: HTTP request, HTTP response, database requests, timings or even used memory.

All collected information timestamped and sent in your default log channel, with debug level.

Every module can be activated or deactivated separately thanks to the config file. You can configure the timestamp format as you wish.

Artisan

Information are collected when running artisan commands. Artisan collector will collect the command name, argument and options when collection comes from an artisan command.

Counter

The counter can help to count stuffs. The counter does not need to exist before incrementing it. As it is initialized with 0.

Counters can be incremented by more than one.

Database

Every executed database query is collected with its bindings and duration. The total number of executed queries is also logged.

You can define a threshold and raise a warning if the number of executed queries is above this threshold.

Memory

The Memory collector will collect the memory peak usage and add it to the log.

You can define a threshold and raise a warning if the memory peak usage id above this threshold.

Message

You can send messages in the debugger flow calling Debug::message

Model

When enabled, the collector allows you to count the number of models retrieved from the database during the queries.

Request

Request data can be collected. We store HTTP verb, url and parameters.

Response

Response can also be collecter with its status code and body.

Time

Time collector will automatically measure booting time (laravel) and application time (your application).

It is possible to time performance portions via the facade :

startMeasure and stopMeasure calls do not have to be in the part of code, but a measure cannot be stopped if not started (nor started if already running).

Above example can be simplified using Debug::measuring method :

All running measurements are stopped before logging.

You can also measure multiple times with the same key. All measures are stored together, and the log will provide you some statistics.

Finally, you can define a threshold and raise a warning if the application duration is above this threshold.

Special use case of HTTP testing

When doing http testing, it is common to bootstrap database or execute some operation we do not want to add to our debug log.

For example:

We are actually not interested in (for example) database queries of factory(\App\User::class)->create() nor assertDatabaseHas.

This package will take care of drop any collected information during bootstrap and return only interesting ones i.e. what occurred in $this->putJson("api/users/{$user->id}",['name' => 'John Doe']). You just have to ensure that you are using testing environment during your tests (which should already be your case as it is Laravel default).

BottleneckMiddleware

This middleware adds some latency to your requests, server side. It can be useful to check how your application behaves when the user does not have a good network connection.

Soyhuce\DevTools\Middlewares\BottleneckMiddleware can be used as a classic middleware. To use it, just add the middleware in your App/Http/Kernel.php or in your route file(s).

You can modify bottleneck duration in config/dev-tools.php file.

You also may want to apply it for only ajax requests. If so, adjust the only_ajax value. Please ensure that the ajax requests are sent with the X-Requested-With header set to XMLHttpRequest.

Image Faker

Sometimes you want to generate images locally for testing, placeholders, ...

You can then use Soyhuce\DevTools\Faker\Image to do so. For this, you have to install intervention/image.

It will generate an image with random color and with the given text (or "width x height"). For example :

Image::generate(200, 150)

Image::generate(300, 100, 'The colors are not that good', 'png')

See intervention/image documentation to know how to use returned image.


All versions of dev-tools with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/http Version ^10.15 || ^11.0
illuminate/support Version ^10.15 || ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package soyhuce/dev-tools contains the following files

Loading the files please wait ....