forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole.php
More file actions
30 lines (27 loc) · 1.12 KB
/
console.php
File metadata and controls
30 lines (27 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use Illuminate\Foundation\Inspiring;
/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->describe('Display an inspiring quote');
Artisan::command('notifications:resend {username}', function ($username) {
$user = ProcessMaker\Models\User::where('username', $username)->firstOrFail();
$tokens = ProcessMaker\Models\ProcessRequestToken
::where('status', 'ACTIVE')
->where('user_id', $user->getKey())
->get();
foreach ($tokens as $token) {
dump($token->id);
$notification = new ProcessMaker\Notifications\ActivityActivatedNotification($token);
$user->notify($notification);
}
})->describe('Resend to user the notifications of his/her active tasks');