Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Development/PushClientCommand.php
- This file was added.
<?php | |||||
namespace App\Console\Development; | |||||
use App\Backends\Events; | |||||
use App\Console\Command; | |||||
class PushClientCommand extends Command | |||||
{ | |||||
/** | |||||
* The name and signature of the console command. | |||||
* | |||||
* @var string | |||||
*/ | |||||
protected $signature = 'push:client {client} {message} {--type=}'; | |||||
/** | |||||
* The console command description. | |||||
* | |||||
* @var string | |||||
*/ | |||||
protected $description = 'Push server-side event (notification) to a mobile device.'; | |||||
/** | |||||
* Execute the console command. | |||||
* | |||||
* @return mixed | |||||
*/ | |||||
public function handle() | |||||
{ | |||||
$client = $this->argument('client'); | |||||
$message = $this->argument('message'); | |||||
$type = $this->option('type') ?: 'message'; | |||||
Events::pushMessageToClient($client, $message, $type); | |||||
} | |||||
} |