<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/13
 * Time: 9:52
 */
namespace Modules\Base\Services;

class BaseService
{
    protected $model;

    public function create($data)
    {
        return $this->model = $this->model->create($data)->refresh();
    }

    public function update($id, $data)
    {
        $this->model = $this->model->find($id);

        $this->model->fill($data);

        return $this->model->save();
    }

    public function getModel()
    {
        return $this->model;
    }
}
