Rômulo Santos
Rômulo Santos

Reputation: 23

artisan not working in laravel 5.2 returning [ErrorException]

I'm getting problem when trying to execute php artisan "command". Does not matter the command.

For example, executing the command:

php artisan make:controller TestController

I have got the following result

  [ErrorException]
  Undefined variable: ths

What I have tried to do?

I have tried to update/install composer

composer update
composer install
composer dump-autoload

It's causing me a lot of problem for example I can't execute my migration in another words I can't take the next steps.

Would be great if someone has some idea how to fix that.

Thank's a lot

Upvotes: 2

Views: 225

Answers (2)

Jonathan Brizio
Jonathan Brizio

Reputation: 1210

I suggest finding this in your code. If you use Sublime Text press:

The keyboard shortcut is Ctrl⇧+F on non-Mac (regular) keyboards, and ⌘⇧+F on a Mac.

And put $this on this variable instead of $ths

Upvotes: 0

Alexey Mezenin
Alexey Mezenin

Reputation: 163978

This error means that somewhere you have a class with $ths variable and it's not related to commands. I think you wrote some code and used $ths instead of $this. Check all last changes (custom commands, facades, service providers etc). Just fix it and commands will work again.

If you can't find $ths in your code, check Laravel error logs for extra info.

Upvotes: 3

Related Questions