<?php

namespace App\Http\Controllers;

use Exception;
use Illuminate\Http\Request;

class OneSignal extends Controller
{
    public function getPlayerId($email) {
        try{
            $data = \DB::table('tb_users')->select('playerid')->where('email', $email)->first();
            return json_encode(array(
                'status'=> 'success',
                'playerid' => $data->playerid
            ));
        } catch(Exception $e) {     
            
        }
        return json_encode([
            'status'=> 'error',
            'msg' => 'unable to get player id'
        ]);
    }

}
