<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;

class Content extends BaseModel
{
    use HasFactory;
    protected $fillable=['terms_service'];
    public function insert($inputData)
    {
        $result=[];
        $termandservice = self::where('id',$inputData['id'])->first();
        if(!empty($termandservice)){
            $termandservice->terms_service = $inputData['terms_service'];
            $result['data'] =  $termandservice->save();
            $result['message']='update successfully';
        }
        else {
            $result['data'] = self::create($inputData);
            $result['message']='save successfully';
        }
        $result['status']=true;
        return $result;

    }
    public function get(){
        return self::first();
    }
}
