Download the PHP package amjdhsan/larascope without Composer

On this page you can find all versions of the php package amjdhsan/larascope. 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 larascope

LaraScope

A Laravel package that logs HTTP requests, duration, status, SQL queries, and memory usage — with a built-in web dashboard to browse and inspect them.

Features

Requirements

Dependency Version
PHP ^8.1
Laravel ^10.0 \| ^11.0 \| ^12.0 \| ^13.0

Installation

Install the package via Composer:

The package is auto-discovered — no manual provider registration needed.

Coming from amjad-ah/larascope? That package is abandoned as of 2.0.0. The package name, the root namespace (AmjadAH\LaraScope\ → Amjad\LaraScope\) and the table schema all changed — see CHANGELOG.md for the upgrade steps.

Run the migration to create the larascope_request_logs table:

That's it. LaraScope is now logging every HTTP request in the web and api middleware groups.

Dashboard

Open /larascope in your browser to browse captured logs.

The list view opens with a summary strip — request count, error rate, average and slowest duration, and how many requests ran a slow query — computed over whatever the active filters match, so the figures always describe the rows below them.

Each row draws its duration as a bar scaled against the slowest request on the page, so an outlier is visible before you read a number. The bar turns amber when the request ran a slow query.

The detail view shows the full SQL query log (with bindings, per-query timing bars and slow-query flags), request headers, memory peak, and duration.

Filters

Filters combine with AND, and every one is a plain query-string parameter — bookmark a filtered view or share the URL.

Filter Parameter Notes
HTTP method method[] Multi-select; case-insensitive
Status class status_class 2xx, 3xx, 4xx, 5xx
Exact status status e.g. 404
Path path Substring match
Route name route Substring match
IP address ip Substring match, so 10.0. matches a subnet
User ID user_id Exact match
Time window from, to Any parseable datetime
Quick range range 15m, 1h, 24h, 7d — ignored when from/to are set
Min duration min_duration Milliseconds
Min memory min_memory Megabytes
Min queries min_queries Query count
Slow queries only slow=1 Requests that ran at least one slow query
Sort sort recent (default), slowest, memory, queries

Unknown, blank and malformed values are ignored rather than raising an error, so a hand-edited URL can never break the page. Active filters appear as chips above the table; each chip's × removes just that one filter.

Tailwind CSS is loaded via CDN — no asset pipeline required. The dashboard follows your OS light/dark preference and remembers the toggle in localStorage.

Protecting the dashboard in production

Add Laravel's auth middleware (or any middleware you prefer) to the dashboard:

Configuration

Publish the config file to customise any option:

Environment variables

Variable Default Description
LARASCOPE_ENABLED true Master switch — disables all logging and middleware registration when false
LARASCOPE_DB_CONNECTION null (Laravel default) Database connection to use for storing logs
LARASCOPE_DB_TABLE larascope_request_logs Table name for log storage
LARASCOPE_DASHBOARD_ENABLED true Enable or disable the web dashboard
LARASCOPE_DASHBOARD_PATH larascope URL path for the dashboard

Full config reference

Excluding paths and methods

Skip specific routes using wildcards (powered by Str::is()):

The dashboard's own routes are always excluded automatically to prevent recursive log growth.

Captured data

Each log entry stores 16 fields:

Field Type Description
method string HTTP verb (GET, POST, …)
url string Full request URL including query string
path string URL path segment only
route_name string\|null Named route, if resolved
ip_address string\|null Client IP address
user_id int\|null Authenticated user ID (Auth::id())
status_code int HTTP response status code
duration_ms float Request duration in milliseconds
memory_peak_mb float Peak memory usage in megabytes
query_count int Number of SQL queries executed
has_slow_queries bool Whether any query crossed the slow threshold — indexed, so the dashboard can filter on it
queries json Array of queries with sql, bindings, time_ms, and slow flag
request_headers json\|null Sanitised request headers
request_body json\|null Request input (opt-in)
response_body json\|null Response content (opt-in), stored as {"content-type": ..., "content": ...}
created_at timestamp When the log entry was created

Indexes

The migration indexes created_at, method, status_code, user_id, duration_ms and has_slow_queries — the columns the dashboard filters and sorts on. The substring filters (path, route_name, ip_address) match with a leading wildcard and cannot use an index, so they are deliberately left unindexed.

Upgrading from 1.x? The has_slow_queries column and these indexes are part of the original migration, so an install that already migrated will not pick them up. Until the column exists, every insert fails and lands in the application log via the fallback path. CHANGELOG.md has the migration to run.

Artisan commands

Prune old logs

Deletes all log entries older than pruning.retain_days (default: 30 days). Schedule this command to keep your table from growing unbounded:

Publishing assets

Architecture

Both LaraScopeMiddleware and RequestLogger are bound as singletons so the same instance handles both handle() and terminate(). Per-request state ($collectedQueries, $shouldSkip) is reset at the top of every handle() call, making the package safe under persistent runtimes like Laravel Octane.


All versions of larascope with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.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 amjdhsan/larascope contains the following files

Loading the files please wait ...