PHPackages                             danielemontecchi/laravel-basics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. danielemontecchi/laravel-basics

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

danielemontecchi/laravel-basics
===============================

Zero-setup starter kit for Laravel with strict mode, performance tools, sensible defaults, and developer protections.

v1.1.2(3mo ago)0252MITPHPPHP ^8.1 || ^8.2 || ^8.3 || ^8.4CI passing

Since Apr 26Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/danielemontecchi/laravel-basics)[ Packagist](https://packagist.org/packages/danielemontecchi/laravel-basics)[ Docs](https://danielemontecchi.com)[ RSS](/packages/danielemontecchi-laravel-basics/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (6)Dependencies (14)Versions (14)Used By (0)

Laravel Basics Package
======================

[](#laravel-basics-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1304956afc10fd5dd5c8087ad1b4a65d1bfad488fb13ea6c0f3e3670981f9a42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616e69656c656d6f6e7465636368692f6c61726176656c2d6261736963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/danielemontecchi/laravel-basics)[![Total Downloads](https://camo.githubusercontent.com/f83ea39544f58e3959b8ef6dacf90b3982633f5c30068374c3f2dba2f8d7dc73/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616e69656c656d6f6e7465636368692f6c61726176656c2d6261736963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/danielemontecchi/laravel-basics)[![License: MIT](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![GitHub Tests Action Status](https://camo.githubusercontent.com/7597e44ba4124aeab17ab01bd9101c1e61ad63947dd4c123e7a12fd143e7386e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64616e69656c656d6f6e7465636368692f6c61726176656c2d6261736963732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/danielemontecchi/laravel-basics/actions/workflows/tests.yml)[![Coverage](https://camo.githubusercontent.com/af912976bb50808a5278412d9bef95ded611d84dc48bfe71685ba72b956c4eb5/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d64616e69656c656d6f6e7465636368695f6c61726176656c2d626173696373266d65747269633d636f766572616765)](https://sonarcloud.io/summary/new_code?id=danielemontecchi_laravel-basics)[![PHPStan](https://camo.githubusercontent.com/cfad767368c5b88c30d3a7087a14099cb45895b5ded11e2ae54aa298b7ba5893/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c2532306d61782d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://phpstan.org/)[![Quality Gate Status](https://camo.githubusercontent.com/f3b52195bf4a6f4d7b351cdf3d5f443bbd600fbe9ff5825def846f060b54d962/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d64616e69656c656d6f6e7465636368695f6c61726176656c2d626173696373266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/summary/new_code?id=danielemontecchi_laravel-basics)[![Maintainability Rating](https://camo.githubusercontent.com/1fe515c34d227747335c840096abbd8a90b00111224ec15243eea5e58b98c61c/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d64616e69656c656d6f6e7465636368695f6c61726176656c2d626173696373266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/summary/new_code?id=danielemontecchi_laravel-basics)[![Documentation](https://camo.githubusercontent.com/09e816ae34b01c0a0c356178a99f4041e3c82696002ef2dd521eb5b0f16c6ace/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d617661696c61626c652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://danielemontecchi.github.io/laravel-basics)

A zero-setup package to bootstrap your Laravel projects with a collection of sensible defaults, strict mode helpers, developer protections, and performance tooling. Inspired by [nunomaduro/essentials](https://github.com/nunomaduro/essentials).

---

Requirements
------------

[](#requirements)

- PHP `^8.1 || ^8.2 || ^8.3 || ^8.4`
- Laravel `^10.0 | ^11.0 | ^12.0 | ^13.0`

---

Installation
------------

[](#installation)

```
composer require danielemontecchi/laravel-basics
```

The package auto-registers via Laravel's service provider discovery.

---

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=laravel-basics-config
```

This will create `config/laravel-basics.php`, where each feature can be individually enabled or disabled.

---

Full Setup: Development Tools, Code Style and Git Hooks
-------------------------------------------------------

[](#full-setup-development-tools-code-style-and-git-hooks)

Run the following command to interactively install and configure useful development tools:

```
php artisan basics:setup
```

This command will offer to install and configure the following:

- **Laravel Folio**: page based routing for Laravel.
- **Laravel Octane**: supercharge your Laravel application's performance.
- **Laravel Pulse**: real-time application performance monitoring dashboard.
- **Laravel Reverb**: real-time WebSocket communication backend for Laravel.
- **Laravel Debugbar**: debugbar for Laravel applications.
- **Log Viewer**: fast and beautiful Log Viewer for Laravel logs.
- **Laravel Ray**: debug with Ray to fix problems faster.
- **Laravel Backup**: backup your Laravel applications.
- **Symfony Security Checker**: scan your app dependencies for known vulnerabilities.
- **Predis**: a flexible and feature-complete Redis/Valkey client for PHP.
- **Laravel Horizon**: dashboard and queue configuration for Laravel queues.
- **PHP-CS-Fixer**: a tool to automatically fix PHP Coding Standards issues.
- **PHPStan**: discover bugs in your code without running it (static analysis).
- **EditorConfig**: helps maintain consistent coding styles for multiple developers.
- **Pest**: an elegant PHP testing framework.
- **Peck**: identifies wording or spelling mistakes in your codebase.
- **Laravel IDE Helper**: generates IDE helper files for better autocompletion.
- **Husky Git Hooks**: improves your commits and more.
- **gitignore**: a standard gitignore file for Laravel projects.

You can safely rerun this command. It will never overwrite files without asking for confirmation.

---

Available Features
------------------

[](#available-features)

### ✅ AutomaticallyEagerLoadRelationships

[](#-automaticallyeagerloadrelationships)

Enables automatic eager loading of relationships listed in `$touches` (Laravel 10.37+). Prevents N+1 queries caused by deferred loading of touched relations.

### ✅ DefaultPasswordRules

[](#-defaultpasswordrules)

Enforces stricter password validation globally in production: minimum 12 characters, maximum 50, and cross-checked against known data breach databases. No rules are enforced in non-production environments.

### ✅ DisableQueryLog

[](#-disablequerylog)

Disables the Eloquent query log in production. The log accumulates all executed queries in memory and is only useful during debugging — leaving it enabled causes silent memory growth in long-running processes.

### ✅ FakeSleep

[](#-fakesleep)

Mocks `Sleep::for(...)` during tests so no real time is spent waiting. Keeps the test suite fast without changing application code.

### ✅ ForceHttpsScheme

[](#-forcehttpsscheme)

Forces all generated URLs to use HTTPS via `URL::forceScheme('https')`. Useful when the app runs behind a proxy or CDN that terminates SSL.

### ✅ HttpClientGlobalTimeout

[](#-httpclientglobaltimeout)

Sets a global timeout (default: 30 seconds) for all outgoing `Http::` client requests. Prevents hanging requests from blocking production workers indefinitely. Set the value in seconds; use `false` to disable.

### ✅ ImmutableDates

[](#-immutabledates)

Replaces mutable `Carbon` instances with `CarbonImmutable` across the entire application. Prevents accidental date mutations when passing date objects between methods.

### ✅ LogSlowQueries

[](#-logslowqueries)

Logs database queries exceeding a configurable threshold (default: 100ms) as warnings. Helps surface performance issues early in development and staging.

### ✅ PreventAccessingMissingAttributes

[](#-preventaccessingmissingattributes)

Throws an exception when accessing a model attribute that has not been loaded or does not exist. Catches typos and missing `select()` columns that would otherwise fail silently.

### ✅ PreventLazyLoading

[](#-preventlazyloading)

Throws an exception for any lazy-loaded relationship in non-production environments. Forces eager loading and prevents N+1 query problems from reaching production undetected.

### ✅ PreventSilentlyDiscardingAttributes

[](#-preventsilentlydiscardingattributes)

Throws an exception if attributes unknown to the model are passed to `fill()` or `create()`. Prevents silent data loss caused by mismatched field names or typos in mass assignments.

### ✅ PreventStrayHttpRequests

[](#-preventstrayhttprequests)

Prevents real HTTP requests from being made during tests unless explicitly faked with `Http::fake()`. Protects against tests accidentally calling external services.

### ✅ ProhibitDestructiveCommands

[](#-prohibitdestructivecommands)

Blocks Artisan commands like `migrate:fresh`, `db:wipe`, and `migrate:reset` in production. Reduces the risk of irreversible data loss from accidental command execution.

### ✅ SchemaDefaultStringLength

[](#-schemadefaultstringlength)

Sets the default string column length for migrations (default: 191). Required for utf8mb4 charset support on older MySQL and MariaDB versions.

### ✅ SetDefaultTimezone

[](#-setdefaulttimezone)

Sets the PHP runtime timezone from the `app.timezone` config value. Complements `SetLocale` to ensure both locale and timezone are consistently applied from the application configuration.

### ✅ SetLocale

[](#-setlocale)

Sets the PHP and Carbon locale using the current `app.locale` config value. Ensures date formatting and string operations use the correct language settings.

### ✅ ShouldBeStrict

[](#-shouldbestrict)

Enables Eloquent strict mode globally in non-production environments. Combines `PreventLazyLoading`, `PreventSilentlyDiscardingAttributes`, and `PreventAccessingMissingAttributes` into a single model-level setting.

### ✅ TrustProxies

[](#-trustproxies)

Configures trusted proxies for applications running behind load balancers or CDNs. Required for `ForceHttpsScheme` and correct client IP detection to work reliably when the app sits behind a reverse proxy. Trusts `127.0.0.1` and `::1` by default.

### ✅ UnguardModels

[](#-unguardmodels)

Disables Laravel mass-assignment protection globally. Use only in safe, controlled environments such as internal tools, seeders, or closed systems.

### ✅ ViteAggressivePrefetching

[](#-viteaggressiveprefetching)

Enables aggressive chunk prefetching in Vite to reduce navigation latency in SPAs.

---

License
-------

[](#license)

Laravel Basics is open-source software licensed under the **MIT license**. See the [LICENSE.md](LICENSE.md) file for full details.

---

Made with ❤️ by [Daniele Montecchi](https://danielemontecchi.com)

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance82

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Recently: every ~81 days

Total

13

Last Release

91d ago

PHP version history (3 changes)v1.0.0PHP ^8.1|^8.2|^8.3

v1.0.7PHP ^8.1|^8.2|^8.3|^8.4

v1.0.8PHP ^8.1 || ^8.2 || ^8.3 || ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2247871?v=4)[Daniele Montecchi](/maintainers/danielemontecchi)[@danielemontecchi](https://github.com/danielemontecchi)

---

Top Contributors

[![danielemontecchi](https://avatars.githubusercontent.com/u/2247871?v=4)](https://github.com/danielemontecchi "danielemontecchi (23 commits)")

---

Tags

bootstrapdefaultsdeveloper-experienceessentialshelperslaravellaravel-packageperformancephpsetuptoolinglaravelperformancebootstrapessentialssetupdeveloper-experiencestrict-mode

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/danielemontecchi-laravel-basics/health.svg)

```
[![Health](https://phpackages.com/badges/danielemontecchi-laravel-basics/health.svg)](https://phpackages.com/packages/danielemontecchi-laravel-basics)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[anahkiasen/former

A powerful form builder

1.3k1.4M14](/packages/anahkiasen-former)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
