File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ abstract class AbstractRepository implements RepositoryContract
4848 /**
4949 * @var \Illuminate\Database\Eloquent\Builder
5050 */
51-
5251 protected $ query ;
5352
5453 /**
@@ -703,9 +702,17 @@ public function getErrorMessage($default = '')
703702 */
704703 protected function appendTableName ($ column )
705704 {
706- return (strpos ($ column , '. ' ) === false )
707- ? $ this ->modelInstance ->getTable () . '. ' . $ column
708- : $ column ;
705+ // If missing prepend the table name
706+ if (strpos ($ column , '. ' ) === false ) {
707+ return $ this ->modelInstance ->getTable () . '. ' . $ column ;
708+ }
709+
710+ // Remove alias prefix indicator
711+ if (substr ($ column , 0 , 2 ) === '_. ' ) {
712+ return preg_replace ('/^_\./ ' , '' , $ column );
713+ }
714+
715+ return $ column ;
709716 }
710717
711718 /**
You can’t perform that action at this time.
0 commit comments