File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 3
3
namespace DragonCode \LaravelSupport \Support ;
4
4
5
5
use DragonCode \LaravelSupport \Exceptions \IncorrectModelException ;
6
+ use Illuminate \Database \Eloquent \Builder ;
6
7
use Illuminate \Database \Eloquent \Model ;
7
8
8
9
class ModelHelper
@@ -82,6 +83,20 @@ public function primaryKeyType($model): string
82
83
->getKeyType ();
83
84
}
84
85
86
+ /**
87
+ * @param \Illuminate\Database\Eloquent\Model|string $model
88
+ *
89
+ * @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
90
+ *
91
+ * @return \Illuminate\Database\Eloquent\Builder
92
+ */
93
+ public function query ($ model ): Builder
94
+ {
95
+ return $ this
96
+ ->model ($ model )
97
+ ->newQuery ();
98
+ }
99
+
85
100
/**
86
101
* @param \Illuminate\Database\Eloquent\Model|string $model
87
102
*
You can’t perform that action at this time.
0 commit comments