Skip to content

Commit

Permalink
Update AutoWhere.php
Browse files Browse the repository at this point in the history
  • Loading branch information
maikealame authored Jan 13, 2023
1 parent 3d16775 commit 12b2728
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/AutoWhere.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ trait AutoWhere
public function scopeAutoWhere($query, $options = [])
{
// Alias options
$autowhere = Auto::setPdo(DB::connection($query->getConnection()->getConfig()['driver'])->getPdo())->where();
$connConfig = $query->getConnection()->getConfig();
$autowhere = Auto::setPdo(DB::connection($connConfig['name'] ? $connConfig['name'] : $connConfig['drive'])->getPdo())->where();
$qb = $query->getQuery();
$table = [];
if( is_array( $qb->joins ) ){
Expand Down

0 comments on commit 12b2728

Please sign in to comment.