Artisan::call() not working in Laravel 4

Artisan is a great commandline tool for Laravel Framework. It provides support for application development using powerful Symfony console component.

Just the other day i was working on a Laravel 4 package for my own practice and i found the need to run migrations for my database and Artisan came in handy doing that but i had to automate the whole process so that the migrations would run on package initiation. Now, thinking about commandline and PHP one though comes to mind : exec. But fortunately, Laravel provides an equally powerful API for running Artisan commands from inside the Laravel project.

Now, that is what you call a utility!

All i had to do was run following construct:

But it did not work, evidently because of ever evolving nature of Laravel documentation which failed to mention the correct syntax. But the following worked for me 🙂

works forLaravel 4.1+

alexey

Application developer, movie buff, occasional reader and a huge Manchester United fan.
alexey
Share

Application developer, movie buff, occasional reader and a huge Manchester United fan.