Skip to content

add support for serializable config #15

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

Merged
merged 4 commits into from
Oct 4, 2023
Merged

Conversation

kswilliames
Copy link
Contributor

@kswilliames kswilliames commented Aug 29, 2022

This PR adds support for serializable cached config using PHP callables. Callables can be used to pass a callable class to the config array which is serialized to the cache, then called as a callable function on run-time.

Also incorporates @crezra's support for Laravel 9

For example:

// config/masked-dump.php
...
  'default' => [MaskedDump::class, 'define'],
...

// app/Support/MaskedDump.php

class MaskedDump
{
  public static function define()
  {
    return DumpSchema::define()->allTables();
  }
}

@kswilliames
Copy link
Contributor Author

Closes #11

@mechelon
Copy link
Member

mechelon commented Oct 4, 2023

Thanks!

@vpillinger-highwater
Copy link

@kswilliames This is a big necro but can you please update the website documentation to make this the preferred documented method? Breaking the serialization on the cache is a really big deal for any production application.

The main use-case of this package that I see is automating prod db exports, so the documentation is foot-gunning developers.

@kswilliames
Copy link
Contributor Author

kswilliames commented Mar 29, 2025

@kswilliames This is a big necro but can you please update the website documentation to make this the preferred documented method? Breaking the serialization on the cache is a really big deal for any production application.

The main use-case of this package that I see is automating prod db exports, so the documentation is foot-gunning developers.

@vpillinger-highwater No worries for the necro. Sorry you had to experience the troubles, even after the fix! Although, it has been a while since I've worked with this plugin, Laravel or even PHP. Please review the new documentation PR and confirm that it's correct.

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.

4 participants