<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use App\Mail\NotificationEmail;
use App\Models\NotificationModel;
use App\Models\PrescriptionOrderModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;

class NotificationController extends Controller
{
    public function api_show($user_id){
        // return 'This is Dashboard';
        $notifications = NotificationModel::where('uid', $user_id)->get();

        if ($notifications->isEmpty()) {
            // return response()->json(['message' => 'No notifications found for this user'], 422);
            return response()->json(['message' => __("noNotificationFound")], 422);
        }
        return response()->json(['data' => $notifications], 200);
     }

     public function web_push(){

        $p_order = PrescriptionOrderModel::where('o_status', 2)->get();
        return response()->json(['orders' => "success"], 200);

     }
}
