<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class {{modelName}} extends Model
{
	 /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = '{{tableName}}';

    public static function newRecord($request)
    {
        $data= new {{modelName}};
        {{request}}
        $data->save();

        return $data;
    }

    public static function updateRecord($request, $id)
    {
        $data = {{modelName}}::findOrFail($id);
        {{request}}
        $data->save();

        return $data;
    }
}