laravel/tinker
Laravel Tinker is a powerful REPL for Laravel, letting you interact with your application from the command line. Run Artisan’s tinker command to test code, inspect models, and debug quickly in an interactive shell.
composer require laravel/tinker and integrates with the artisan tinker command. No additional setup is required beyond Laravel’s standard bootstrapping.--execute.config/tinker.php.--execute for one-off tasks).memory_limit in php.ini) need adjustment for REPL sessions?App\Services\*) without manual instantiation.migrate:status) via --execute.Cache::, Log::) as if in a controller.php artisan tinker --execute="User::first()->toArray()").phpunit for interactive test debugging.composer require laravel/tinker (if not pre-installed).User::where('active', false)->count()).composer.json (Tinker pins ~0.12 in v3.x).config/tinker.php:
return [
'whitelist' => [
'migrate:status',
'db:seed',
],
'casts' => [
App\Models\CustomModel::class => \Laravel\Tinker\Casters\CollectionCaster::class,
],
];
composer update laravel/tinker with version constraints (e.g., ^3.0).config/tinker.php; version-control changes.post-update-cmd to test Tinker after dependency updates:
"scripts": {
"post-update-cmd": "php artisan tinker --execute=\"exit;\""
}
How can I help you explore Laravel packages today?