Skip to content

Commit 06fb04f

Browse files
committed
Add missing $columns arguments
1 parent ea96a3b commit 06fb04f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Repositories/AbstractRepository.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,18 @@ public function find($id, $columns = ['*'])
190190
/**
191191
* Find a model by its primary key or throw an exception.
192192
*
193-
* @para string $id
193+
* @param string $id
194+
* @param array $columns
194195
*
195196
* @return \Illuminate\Database\Eloquent\Model
196197
*
197198
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
198199
*/
199-
public function findOrFail($id)
200+
public function findOrFail($id, $columns = ['*'])
200201
{
201202
$this->newQuery();
202203

203-
if ($result = $this->query->find($id)) {
204+
if ($result = $this->query->find($id, $columns)) {
204205
return $result;
205206
}
206207

@@ -220,7 +221,7 @@ public function findBy($field, $value, $columns = ['*'])
220221
{
221222
$this->newQuery();
222223

223-
return $this->query->where($field, '=', $value)->first();
224+
return $this->query->where($field, '=', $value)->first($columns);
224225
}
225226

226227
/**

0 commit comments

Comments
 (0)