#11 Interacting with database With Tinker Laravel 5 6
Created by Imran Sayed Last updated January, 2020 English
What is php artisan Tinker?
Laravel artisan’s tinker is a repl (read-eval-print loop) used to interact with your application and the database . A repl (read-eval-print-loop
) is an interactive language shell. It takes/reads in a single user input, evaluates it, and returns the result to the user.Examples shown below.
COMMANDS for Terminal
cd projectname
# Start laravel
php artisan serve
# Create controller.
php artisan make:controller ControllerName --resource
# Create Model.
php artisan make:model modelname # model name needs to be singulat e.g. Post
# List all the routes.
php artisan route:list