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

use Modules\Project\Entities\Feedback;

class FeedbackService extends BaseService
{
    public function __construct(Feedback $model)
    {
        $this->model = $model;
    }

    public function update($id, $data)
    {
        return parent::update($id, $data); // TODO: Change the autogenerated stub
    }

    public function delete($id)
    {
        $this->model = $this->model->find($id);

        return $this->model->delete($id);
    }

    public function insert($data)
    {
        $user_id = \Auth()->id();
        $data['user_id'] = $user_id;
        $data['status'] = 0;

        return $this->model = $this->model->create($data);
    }
}
