27 lines
642 B
PHP
27 lines
642 B
PHP
<?php
|
|||
|
|
namespace App\Http\Controllers\Site;
|
||
|
|
|
||
|
|
use App\Http\Controllers\Controller;
|
||
|
|
use App\Services\NotificationService;
|
||
|
|
use Illuminate\Http\Request;
|
||
|
|
|
||
|
|
class myNotificationController extends Controller
|
||
|
|
|
||
|
|
{
|
||
|
|
protected $notificationService;
|
||
|
|
|
||
|
|
public function __construct(NotificationService $notificationService)
|
||
|
|
{
|
||
|
|
$this->notificationService = $notificationService;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function mySendNotification(Request $request)
|
||
|
|
{
|
||
|
|
return 1;
|
||
|
|
$message = $request->input('message');
|
||
|
|
$response = $this->notificationService->sendNotification($message);
|
||
|
|
|
||
|
|
return response()->json($response);
|
||
|
|
}
|
||
|
|
}
|