Skip to content

Commit 78c689f

Browse files
committed
refactor parameter order
1 parent 42f9247 commit 78c689f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app/Library/CrudPanel/Traits/ColumnsProtectedMethods.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ protected function makeSureColumnHasEntity($column)
142142
// if the name is dot notation it might be a relationship
143143
if (strpos($column['name'], '.') !== false) {
144144
$possibleMethodName = Str::before($column['name'], '.');
145-
$model = $this->model;
146-
145+
147146
// if the first part of the string exists as method,
148147
// it is a relationship
149148
if (method_exists($this->model, $possibleMethodName)) {
@@ -155,6 +154,8 @@ protected function makeSureColumnHasEntity($column)
155154

156155
$attribute_in_relation = false;
157156

157+
$model = $this->model;
158+
158159
// here we are going to iterate through all relation parts to check
159160
// if the attribute is present in the relation string.
160161
foreach ($parts as $i => $part) {

0 commit comments

Comments
 (0)