From 0903478fdea1706ea5fe3594465a43bf70e0b844 Mon Sep 17 00:00:00 2001 From: sayliraut Date: Mon, 8 Jul 2024 19:47:25 +0530 Subject: [PATCH] change --- .../Admin/ManageNotificationsController.php | 6 +++ app/Http/Helpers/onesignalhelper.php | 7 --- app/Models/NotificationDetails.php | 2 +- .../manage_notifications_add.blade.php | 53 +++++++++++-------- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/app/Http/Controllers/Admin/ManageNotificationsController.php b/app/Http/Controllers/Admin/ManageNotificationsController.php index f60bcfe..c470b3a 100644 --- a/app/Http/Controllers/Admin/ManageNotificationsController.php +++ b/app/Http/Controllers/Admin/ManageNotificationsController.php @@ -10,6 +10,7 @@ use Exception; use Illuminate\Support\Facades\Log; use App\Helpers\onesignalhelper; use App\Models\ManageState; +use App\Models\Subscriptions; use Illuminate\Support\Facades\DB; class ManageNotificationsController extends Controller @@ -83,6 +84,7 @@ class ManageNotificationsController extends Controller public function store_notificaton_data(Request $request) { try { + $request->validate([ 'image' => 'required|image|mimes:jpeg,png,jpg,gif|max:2048', ]); @@ -102,6 +104,10 @@ class ManageNotificationsController extends Controller $states = $request->states; + // $dateTime = now(); + // $formattedDateTime = $dateTime->format('Y-m-d H:i:s'); + // $unsubscribe = Subscriptions::select('iam_principal_xid')->where('next_payment_date', '>=', $formattedDateTime)->get(); + $userQuery = IamPrincipal::where('is_active', 1) ->where('notification_status', 1) ->where('principal_type_xid', 3) diff --git a/app/Http/Helpers/onesignalhelper.php b/app/Http/Helpers/onesignalhelper.php index 278f80f..7fa88db 100644 --- a/app/Http/Helpers/onesignalhelper.php +++ b/app/Http/Helpers/onesignalhelper.php @@ -66,13 +66,6 @@ class onesignalhelper try { $currentUtcTime = Carbon::now(); - // $data = new NotificationDetails(); - // $data->principal_xid = $customerId; - // $data->type = $type; - // $data->date_added = $currentUtcTime; - // $data->description = $description; - // $data->save(); - $newRecord = NotificationDetails::create([ 'principal_xid' => $customerId, 'type' => $type, diff --git a/app/Models/NotificationDetails.php b/app/Models/NotificationDetails.php index 331938e..a82a486 100644 --- a/app/Models/NotificationDetails.php +++ b/app/Models/NotificationDetails.php @@ -11,7 +11,7 @@ class NotificationDetails extends Model protected $table = "notification_details"; protected $fillable = [ 'id', - 'principal_xid', 'type', 'description', 'image', 'date_added' + 'principal_xid', 'type', 'description', 'image', 'date_added','is_schedule','delivery_schedule' ]; protected $guarded = []; diff --git a/resources/views/Admin/pages/manage_notification/manage_notifications_add.blade.php b/resources/views/Admin/pages/manage_notification/manage_notifications_add.blade.php index 1117140..0908717 100644 --- a/resources/views/Admin/pages/manage_notification/manage_notifications_add.blade.php +++ b/resources/views/Admin/pages/manage_notification/manage_notifications_add.blade.php @@ -140,32 +140,29 @@
Delivery Schedule
-
When should this message start sending ?
-
+
When should this message start sending?
+
-
+
-
+ -
- -