|
4 | 4 | use Illuminate\Container\Container;
|
5 | 5 | use Illuminate\Database\Capsule\Manager as DatabaseCapsule;
|
6 | 6 | use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
| 7 | +use Illuminate\Database\Eloquent\Relations\Relation; |
7 | 8 | use Illuminate\Events\Dispatcher;
|
8 | 9 | use Illuminate\Hashing\BcryptHasher;
|
9 | 10 | use Illuminate\Support\MessageBag;
|
@@ -386,7 +387,7 @@ protected function handleRelationalArray($relationName) {
|
386 | 387 | *
|
387 | 388 | * @param string $method
|
388 | 389 | * @param array $parameters
|
389 |
| - * @return mixed |
| 390 | + * @return Relation|Builder|mixed |
390 | 391 | */
|
391 | 392 | public function __call($method, $parameters) {
|
392 | 393 | if (array_key_exists($method, static::$relationsData)) {
|
@@ -935,21 +936,16 @@ public static function find($id, $columns = array('*')) {
|
935 | 936 |
|
936 | 937 | /**
|
937 | 938 | * Get a new query builder for the model's table.
|
938 |
| - * Overriden from {@link \Model\Eloquent} to allow for usage of {@link throwOnFind}. |
| 939 | + * Overriden from {@link \Model\Eloquent} to allow for usage of {@link throwOnFind} in our {@link Builder}. |
939 | 940 | *
|
940 |
| - * @param bool $excludeDeleted |
| 941 | + * @see Model::newQueryWithoutScopes() |
941 | 942 | * @return \Illuminate\Database\Eloquent\Builder
|
942 | 943 | */
|
943 |
| - public function newQuery($excludeDeleted = true) { |
| 944 | + public function newQueryWithoutScopes() { |
944 | 945 | $builder = new Builder($this->newBaseQueryBuilder());
|
945 | 946 | $builder->throwOnFind = static::$throwOnFind;
|
946 | 947 |
|
947 |
| - // Once we have the query builders, we will set the model instances so the |
948 |
| - // builder can easily access any information it may need from the model |
949 |
| - // while it is constructing and executing various queries against it. |
950 |
| - $builder->setModel($this)->with($this->with); |
951 |
| - |
952 |
| - return $this->applyGlobalScopes($builder); |
| 948 | + return $builder->setModel($this)->with($this->with); |
953 | 949 | }
|
954 | 950 |
|
955 | 951 | /**
|
|
0 commit comments