From 7e6ea11cec258f8e83c5df99db54f57f92d798d1 Mon Sep 17 00:00:00 2001 From: Kevin Javitz Date: Mon, 17 Jan 2022 17:30:42 +0545 Subject: [PATCH] Fixes Issue #82 https://github.com/tareq1988/wp-eloquent/issues/82 maybe you know a better fix let me now --- readme.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e6dffa8..0dd8c78 100644 --- a/readme.md +++ b/readme.md @@ -98,7 +98,14 @@ class CustomTableModel extends Model { if ( isset( $this->table ) ){ $prefix = $this->getConnection()->db->prefix; - return $prefix . $this->table; + $prefixAlready = strpos($this->table,$prefix); + + if($prefixAlready === false){ + return $prefix . $this->table; + } else { + return $this->table; + } + } return parent::getTable();