• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mpyw / scoped-auth / 13674344544

05 Mar 2025 10:54AM UTC coverage: 100.0%. Remained the same
13674344544

push

github

mpyw
wip

12 of 12 relevant lines covered (100.0%)

32.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/ScopedEloquentUserProvider.php
1
<?php
2

3
namespace Mpyw\ScopedAuth;
4

5
use Illuminate\Auth\EloquentUserProvider;
6
use Illuminate\Database\Eloquent\Builder;
7

8
class ScopedEloquentUserProvider extends EloquentUserProvider
9
{
10
    /**
11
     * @param null|\Illuminate\Database\Eloquent\Model $model
12
     */
13
    public function newModelQuery($model = null): Builder
14
    {
15
        $query = parent::newModelQuery($model);
40✔
16

17
        $instance = $query->getModel();
40✔
18

19
        if ($instance instanceof AuthScopable) {
40✔
20
            $query = $instance->scopeForAuthentication($query);
32✔
21
        }
22

23
        return $query;
40✔
24
    }
25
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc