Skip to content

Commit

Permalink
Update Database.php
Browse files Browse the repository at this point in the history
  • Loading branch information
accgit authored Aug 16, 2024
1 parent c907cce commit e5ba75b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Drago/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,11 @@ public function find(string $column, int|string $args): FluentExtra
/**
* @throws AttributeDetectionException
*/
public function delete(int $id = null): FluentExtra
public function delete(string $column, int|string $args): FluentExtra
{
$command = $this->command()->delete()
->from($this->getTableName());

if ($id > 0) {
$command->where('%n = ?', $this->getPrimaryKey(), $id);
}

return $command;
return $this->command()->delete()
->from($this->getTableName())
->where('%n = ?', $column, $args)
}


Expand Down

0 comments on commit e5ba75b

Please sign in to comment.