laravel/tinker
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
illuminate/console | v11.7.0 | - | MIT | prod dev | |
illuminate/contracts | v11.7.0 | - | MIT | prod | |
illuminate/support | v11.7.0 | - | MIT | prod | |
psy/psysh | v0.12.3 | 334.24 kB | MIT | prod | |
symfony/var-dumper | v7.0.7 | - | MIT | prod dev |
Laravel Tinker serves as a powerful and robust REPL (Read–Eval–Print–Loop) for the Laravel framework. This package allows developers to interact with their entire Laravel application from the command line, providing a quick and efficient method to tinker with the app's data, run commands and execute bits of code to test logic before actually implementing it into the application.
Using Laravel Tinker is quite straightforward. After installing Laravel Tinker via Composer - using the command composer require laravel/tinker
- you can enter the Tinker environment by simply running php artisan tinker
in your terminal. In this Tinker shell, you can execute any Laravel code or even vanilla PHP code. For instance, if you have a User model in your application, you can tally the total number of users with something like App\Models\User::count();
. The result will be promptly displayed in the console. Remember to exit the Tinker environment after you're done by typing exit
.
The official Laravel Tinker documentation is available on the Laravel website itself. You can access it by visiting the link: https://laravel.com/docs/artisan#tinker. This documentation provides a comprehensive guide to understanding and using Laravel Tinker effectively, along with examples and common use cases. Make sure to refer to it for the most up-to-date and correct information about Laravel Tinker.