More work on user linking to existing defined system
This commit is contained in:
32
app/Console/Commands/UserCodeSend.php
Normal file
32
app/Console/Commands/UserCodeSend.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
|
||||
use App\Models\{Address,User};
|
||||
use App\Notifications\AddressLink;
|
||||
|
||||
class UserCodeSend extends Command
|
||||
{
|
||||
protected $signature = 'user:code:send'
|
||||
.' {ftn : FTN to send link code to}'
|
||||
.' {email : User to send the link to}';
|
||||
|
||||
protected $description = 'Send a link to a user';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$ao = Address::findFTN($this->argument('ftn'));
|
||||
$uo = User::where('email',$this->argument('email'))->singleOrFail();
|
||||
|
||||
Notification::route('netmail',$ao->parent())->notify(new AddressLink($ao,$uo));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user