Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an autoloading system to to Capsules #947

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

antonioribeiro
Copy link
Member

@antonioribeiro antonioribeiro commented May 29, 2021

Description

This PR adds that ability for Capsules to autoload files, like a helpers.php:

<?php

return [
    'seo' => ['enabled' => true],

    'autoload' => [
        'files' => [__DIR__ . '/../Base/helpers.php'],
    ],
];

In the future, maybe, this could be done by using Composer itself, but I have the impression it would drag everyone feet if we have to always go back to Composer.json to add stuff.

What this doesn't solve is a possible Capsule need to override a Laravel helper (or any other package), as files are being loaded too late on the application lifecycle.

This is, of course, a very rudimentary autoloading system. 😆

@ifox ifox merged commit cec70d0 into area17:2.x Jun 21, 2021
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.

2 participants