<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;

class UserWave extends BaseModel
{
    use HasFactory;
    protected $fillable=['user_id','wave'];

    public function insertUserWave($inputData)
    {
       $result=[];
       $result['data']= self::create($inputData);
       $result['message']='save successfully';
       $result['status']=true;
       return $result;

    }
    public function getUserWaveByUserId($user_id){
        return self::where('user_id',$user_id)->latest()->take(1)->first();
    }
    public function getUserWaveById($id){
        return self::where('id',$id)->first();
    }

}
