user2002495
user2002495

Reputation: 2146

Laravel 4: Any way to run PHP Artisan command in PHP code?

I'm fairly new on Laravel's technology regarding real-time application. I'm trying to make a notification system and from what I Google, using some kind of socket server is the best way.

So I'm trying to use this: https://github.com/BrainBoxLabs/brain-socket

But I have no idea how to run it on live server later, since I don't own the server itself I can't run commands like: php artisan brainsocket:start in terminal, so I need to figure out how to run that command by using php code?

Or if my method is wrong, how to use that brain-socket in live server?

Upvotes: 1

Views: 1061

Answers (1)

bthecohen
bthecohen

Reputation: 486

You can do this with

Artisan::call('brainsocket:start', $args);

where $args is an array of arguments.

See the Laravel docs.

Upvotes: 1

Related Questions