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

fix: Laravel 10 support #64

Merged
merged 2 commits into from
Feb 18, 2025
Merged

fix: Laravel 10 support #64

merged 2 commits into from
Feb 18, 2025

Conversation

riiad
Copy link
Contributor

@riiad riiad commented Feb 15, 2025

This PR ensures compatibility with Laravel 10 by replacing calls to Config::arr and Config::string with the config helper.

fixes #57 (comment)

Let me know if you’d like me to add more details! 🚀

@CamKem
Copy link
Contributor

CamKem commented Feb 15, 2025

@riiad - I just added the same thing! Haha (#65)

The only extra bit I added was a method to ensure if the developer changes the types returned by the config when published it gracefully throws an exception:

Maybe you could add this in & I will close my PR?

    private function checkType(mixed $value, string $type): void
    {
        $actualType = gettype($value);
        if ($actualType !== $type) {
            throw new InvalidArgumentException("Config value must be of type {$type}, {$actualType} given.");
        }
    }

@riiad
Copy link
Contributor Author

riiad commented Feb 17, 2025

@CamKem Right, i added a method to check the type.

Copy link
Contributor

@CamKem CamKem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for adding the type check, as per comments. Will close my PR

@aarondfrancis
Copy link
Collaborator

Looks great to me, thank you both @riiad @CamKem!

@aarondfrancis aarondfrancis merged commit 144700b into soloterm:main Feb 18, 2025
8 checks passed
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.

Method Illuminate\Config\Repository::array does not exist.
3 participants