thedoctor0/laravel-stubs

Opinionated versions of the Laravel stubs for Artisan make commands

Maintainers

Package info

github.com/TheDoctor0/laravel-stubs

pkg:composer/thedoctor0/laravel-stubs

Transparency log

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v2.0.0 2026-08-10 12:23 UTC

This package is auto-updated.

Last update: 2026-08-10 13:52:00 UTC


README

Tests Packagist Packagist PHP License

This package contains opinionated versions of the Laravel stubs for Artisan make commands.

Version support

Package Laravel PHP
2.x 11.x, 12.x, 13.x 8.2+
1.x 8.x 7.4+

Changes

  • strict_types are declared by default
  • return type hints are present where possible
  • missing parameter type hints have been added
  • migrations use anonymous classes and don't have a down function
  • the model stub ships a casts() method
  • form requests don't have an authorize function
  • extra stubs Laravel doesn't publish: enums, plain classes, traits, scopes, inbound casts, singleton controllers, and Pest tests

Installation

You can install the package via composer:

composer require thedoctor0/laravel-stubs --dev

If you want to keep stubs up to date, add this hook to your composer.json file:

"scripts": {
    "post-update-cmd": [
        "@php artisan stubs:publish --force"
    ]
}

Usage

You can publish the stubs using this command:

php artisan stubs:publish

Already-published stubs are skipped unless you pass --force.

Testing

composer test

Credits

License

The MIT License (MIT). Please see license file for more information.