Skip to content

Introduce commands autowiring::cache, autowiring::clear to avoid reflection on method autowire#34

Merged
macropay-solutions merged 14 commits intoproductionfrom
autowiring_commands
Feb 1, 2026
Merged

Introduce commands autowiring::cache, autowiring::clear to avoid reflection on method autowire#34
macropay-solutions merged 14 commits intoproductionfrom
autowiring_commands

Conversation

@macropay-solutions
Copy link
Owner

@macropay-solutions macropay-solutions commented Jan 31, 2026

To configure what classes should be cached add in app.autowiring config the list:
These are the defaults.

    /**
     * artisan autowiring::cache source paths for public methods (except __construct).
     * The Controllers and Service providers are handled automatically
     */
    'autowiring' => [
        [
            'path' => \app()->path() . DIRECTORY_SEPARATOR . 'Console' . DIRECTORY_SEPARATOR . 'Commands',
            'methods' => ['handle', '__invoke'],
        ],
        [
            'path' => \app()->path() . DIRECTORY_SEPARATOR . 'Jobs',
            'methods' => ['handle', '__invoke'],
        ],
        [
            'path' => \app()->path() . DIRECTORY_SEPARATOR . 'Http' . DIRECTORY_SEPARATOR . 'Requests',
            'methods' => ['validator', 'authorize', 'after', 'rules'],
        ],
    ],

All registered providers are automatically included for their boot method autowiring. Analog for route used controllers.

The resulting file has 8.8 kB and 520 lines for maravelith 10 test demo project.

    <?php return array (
  'Illuminate\\Database\\DatabaseServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Illuminate\\Foundation\\Providers\\FormRequestServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Illuminate\\Testing\\ParallelTestingServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Illuminate\\Foundation\\Providers\\FoundationServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Illuminate\\Notifications\\NotificationServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Illuminate\\Pagination\\PaginationServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Maatwebsite\\Excel\\ExcelServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Carbon\\Laravel\\ServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Spatie\\LaravelIgnition\\IgnitionServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'MacropaySolutions\\LaravelCrudWizard\\Providers\\CrudProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'MacropaySolutions\\LaravelCrudWizardDecorator\\Providers\\DecoratorProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'App\\Providers\\AppServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'App\\Providers\\AuthServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'App\\Providers\\EventServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'App\\Providers\\RouteServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Laravel\\Sanctum\\SanctumServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'Laravel\\Sail\\SailServiceProvider' => 
  array (
    'boot' => 
    array (
    ),
  ),
  'App\\Http\\Controllers\\ClientsController' => 
  array (
    'list' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'update' => 
    array (
      'identifier' => 
      array (
      ),
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'create' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'get' => 
    array (
      'identifier' => 
      array (
      ),
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'delete' => 
    array (
      'identifier' => 
      array (
      ),
    ),
    'listRelation' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
    ),
    'getRelated' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
    'updateRelated' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
    'deleteRelated' => 
    array (
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
  ),
  'App\\Http\\Controllers\\OperationsController' => 
  array (
    'list' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'update' => 
    array (
      'identifier' => 
      array (
      ),
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'create' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'get' => 
    array (
      'identifier' => 
      array (
      ),
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'delete' => 
    array (
      'identifier' => 
      array (
      ),
    ),
    'listRelation' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
    ),
    'getRelated' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
    'updateRelated' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
    'deleteRelated' => 
    array (
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
  ),
  'App\\Http\\Controllers\\ProductsController' => 
  array (
    'list' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'update' => 
    array (
      'identifier' => 
      array (
      ),
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'create' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'get' => 
    array (
      'identifier' => 
      array (
      ),
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'delete' => 
    array (
      'identifier' => 
      array (
      ),
    ),
    'listRelation' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
    ),
    'getRelated' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
    'updateRelated' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
    'deleteRelated' => 
    array (
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
  ),
  'App\\Http\\Controllers\\OperationsProductsPivotController' => 
  array (
    'list' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'update' => 
    array (
      'identifier' => 
      array (
      ),
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'create' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'get' => 
    array (
      'identifier' => 
      array (
      ),
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
    'delete' => 
    array (
      'identifier' => 
      array (
      ),
    ),
    'listRelation' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
    ),
    'getRelated' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
    'updateRelated' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
    'deleteRelated' => 
    array (
      'identifier' => 
      array (
      ),
      'relation' => 
      array (
      ),
      'relatedIdentifier' => 
      array (
      ),
    ),
  ),
  'Laravel\\Sanctum\\Http\\Controllers\\CsrfCookieController' => 
  array (
    'show' => 
    array (
      'request' => 
      array (
        'c' => 'Illuminate\\Http\\Request',
      ),
    ),
  ),
);

@macropay-solutions macropay-solutions changed the title Introduce commands autowiring::cache, autowiring::clear to avoid reflection on autowire Introduce commands autowiring::cache, autowiring::clear to avoid reflection on method autowire Jan 31, 2026
@macropay-solutions
Copy link
Owner Author

macropay-solutions commented Feb 1, 2026

Added also event:cache and event:clear to Maravel-Microframework. See 10.56.0.

@macropay-solutions macropay-solutions merged commit 9001c45 into production Feb 1, 2026
1 check passed
@macropay-solutions macropay-solutions deleted the autowiring_commands branch February 1, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant