@@ 128-135 (lines=8) @@ | ||
125 | * @param bool $forceFill |
|
126 | * @return mixed |
|
127 | */ |
|
128 | public function create($attributes, $forceFill = false) |
|
129 | { |
|
130 | $model = $this->newInstance(); |
|
131 | $model = $forceFill === false ? $model->fill($attributes) : $model->forceFill($attributes); |
|
132 | $model->save(); |
|
133 | ||
134 | return $model; |
|
135 | } |
|
136 | ||
137 | /** |
|
138 | * update. |
|
@@ 145-152 (lines=8) @@ | ||
142 | * @param bool $forceFill |
|
143 | * @return mixed |
|
144 | */ |
|
145 | public function update($attributes, $id, $forceFill = false) |
|
146 | { |
|
147 | $model = $this->find($id); |
|
148 | $model = $forceFill === false ? $model->fill($attributes) : $model->forceFill($attributes); |
|
149 | $model->save(); |
|
150 | ||
151 | return $model; |
|
152 | } |
|
153 | ||
154 | /** |
|
155 | * delete. |