diff --git a/Models/BaseModel.php b/Models/BaseModel.php index aafc0946..bac02410 100755 --- a/Models/BaseModel.php +++ b/Models/BaseModel.php @@ -40,6 +40,7 @@ abstract class BaseModel extends Model /** @var string */ protected $connection = 'job'; + protected $prefix = '_'; /** @var list */ protected $fillable = ['id']; @@ -55,6 +56,15 @@ abstract class BaseModel extends Model // 'password' ]; + public function __construct(array $attributes = []) + { + if (isset($this->prefix)) { + $this->table = $this->prefix.$this->table; + } + + parent::__construct($attributes); + } + /** * ---- * Create a new factory instance for the model.