14

I recently upgrade Laravel 5.3 to Laravel 5.4. I had read the upgrade guide provided by the laravel, and everything looks good. Until I try to run the Laravel Tinker and it's not working. I already followed the upgrade guide specifically for Laravel Tinker part.

Laravel Tinker

In order to continue using the tinker Artisan command, you should also install the laravel/tinker package:

composer require laravel/tinker

Once the package has been installed, you should add Laravel\Tinker\TinkerServiceProvider::class to the providers array in your config/app.php configuration file.

Source: https://laravel.com/docs/5.4/upgrade

And here is my config/app.php :

'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        Laravel\Tinker\TinkerServiceProvider::class,

But then, when I ran the command "php artisan tinker", it says this:

 [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "tinker" is not defined.

Has anybody experienced this before?

Note: other artisan command works perfectly and I can see my site just fine.

Surya W
  • 145
  • 1
  • 1
  • 6
  • Check `php artisan --version` for your exact Laravel version, and your your composer.lock file (or `composer show laravel/tinker`) for the version of laravel/tinker you've installed. – sisve Jan 27 '17 at 06:45
  • I have the same problem , i looked a solution here but still not working for me https://stackoverflow.com/questions/42635016/command-tinker-is-not-defined – Paolo Falomo May 29 '17 at 13:41

2 Answers2

33

Laravel Tinker

In order to continue using the tinker Artisan command, you should also install the laravel/tinker package:

composer require laravel/tinker

Once the package has been installed, you should add Laravel\Tinker\TinkerServiceProvider::class to the providers array in your config/app.php configuration file.

Source: https://laravel.com/docs/5.4/upgrade

Community
  • 1
  • 1
sisve
  • 19,501
  • 3
  • 53
  • 95
5

Edit your app/Console/Kernel.php, then modify the $commands property with this:

protected $commands = [
    //
    \Laravel\Tinker\Console\TinkerCommand::class,
];

then in console, make a

composer dump-autoload
dotancohen
  • 30,064
  • 36
  • 138
  • 197
Oscar Romero
  • 231
  • 1
  • 2
  • 11