Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Tinker Zero Laravel Package

intonate/tinker-zero

A minimal, zero-config Tinker setup for Laravel. Quickly run tinker in projects without publishing config or extra boilerplate, keeping your environment clean while still getting an interactive REPL for debugging, experimenting, and inspecting app state.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Install the package via Composer: composer require intonate/tinker-zero.
  2. Ensure your Laravel Zero application has laravel/tinker installed as a dependency (it’s required by this package).
  3. Run php your-app-name tinker from your project root—this will start an interactive REPL session preloaded with your app’s service container, just like php artisan tinker in standard Laravel.
  4. The first use case is typically inspecting models or testing Eloquent queries in development: e.g., App\Models\User::first().

Implementation Patterns

  • Use in tinker.php config file (auto-discovered) to define startup code—like loading helpers or aliases—for every Tinker session:
    return [
        'startup' => [
            'echo "Welcome to app Tinker!";',
            '$userFactory = fn() => factory(\App\Models\User::class)->make();',
        ],
    ];
    
  • Leverage Laravel Zero’s command structure: if you have custom commands, you can test their logic interactively without dispatching jobs or re-running scripts.
  • Embed in CI/debug workflows: temporarily add TinkerZero::execute('User::count()'); inside failing command logic for quick introspection (though avoid in production).

Gotchas and Tips

  • No autocomplete or history by default—unlike Artisan Tinker, this package does not include readline support out-of-the-box in Laravel Zero. Ensure ext-readline is enabled for a better experience.
  • The package is unmaintained as of 2021; verify compatibility with newer Laravel Zero versions (e.g., 8.x/9.x) before adopting in new projects.
  • If your app uses custom service providers not auto-loaded in Tinker, manually re-register them in config/tinker.php or app/Console/kernel.php.
  • To extend with custom helpers, define a custom tinker.php config and use require_once __DIR__.'/tinker-helpers.php'; in the startup section.
  • Debug tip: run php your-app-name tinker --no-ansi if encountering formatting or output corruption in Windows terminals.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4