Skip to content

Commit d5351b1

Browse files
committed
Disable "WithTrashed" Function in Repositories
1 parent e2cb9cc commit d5351b1

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

stubs/Models/PHP7.4/Repository/MySqlRepository.stub

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ abstract class MySqlRepository
4646
$query = $this->alternativeDbConnection->table($this->table);
4747
}
4848

49-
if ($this->softDelete) {
50-
if (!$this->withTrashed) {
51-
$query = $query->whereNull('deleted_at');
52-
} else {
53-
$this->withTrashed = false;
54-
}
55-
}
49+
// if ($this->softDelete) {
50+
// if (!$this->withTrashed) {
51+
// $query = $query->whereNull('deleted_at');
52+
// } else {
53+
// $this->withTrashed = false;
54+
// }
55+
// }
5656

5757
return $query;
5858
}
5959

60-
public function withTrashed(): MySqlRepository
61-
{
62-
$this->withTrashed = true;
63-
64-
return $this;
65-
}
60+
// public function withTrashed(): MySqlRepository
61+
// {
62+
// $this->withTrashed = true;
63+
//
64+
// return $this;
65+
// }
6666

6767
/**
6868
* @param int|null $total

stubs/Models/PHP8.0/Repository/MySqlRepository.stub

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ abstract class MySqlRepository
4646
$query = $this->alternativeDbConnection->table($this->table);
4747
}
4848

49-
if ($this->softDelete) {
50-
if (!$this->withTrashed) {
51-
$query = $query->whereNull('deleted_at');
52-
} else {
53-
$this->withTrashed = false;
54-
}
55-
}
49+
// if ($this->softDelete) {
50+
// if (!$this->withTrashed) {
51+
// $query = $query->whereNull('deleted_at');
52+
// } else {
53+
// $this->withTrashed = false;
54+
// }
55+
// }
5656

5757
return $query;
5858
}
5959

60-
public function withTrashed(): MySqlRepository
61-
{
62-
$this->withTrashed = true;
63-
64-
return $this;
65-
}
60+
// public function withTrashed(): MySqlRepository
61+
// {
62+
// $this->withTrashed = true;
63+
//
64+
// return $this;
65+
// }
6666

6767
/**
6868
* @param int|null $total

0 commit comments

Comments
 (0)