We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ba18e1c + d562d82 commit 0eed6e8Copy full SHA for 0eed6e8
src/Support/ModelHelper.php
@@ -3,6 +3,7 @@
3
namespace DragonCode\LaravelSupport\Support;
4
5
use DragonCode\LaravelSupport\Exceptions\IncorrectModelException;
6
+use Illuminate\Database\Eloquent\Builder;
7
use Illuminate\Database\Eloquent\Model;
8
9
class ModelHelper
@@ -82,6 +83,20 @@ public function primaryKeyType($model): string
82
83
->getKeyType();
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
+
100
/**
101
* @param \Illuminate\Database\Eloquent\Model|string $model
102
*
0 commit comments