Issues (23)

src/LockoutAccountServiceProvider.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Irfa\Lockout;
4
5
use Illuminate\Support\ServiceProvider;
6
use Irfa\Lockout\Listeners\LockoutAccount;
7
use Irfa\Lockout\Listeners\LoginLock;
0 ignored issues
show
The type Irfa\Lockout\Listeners\LoginLock was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Irfa\Lockout\Listeners\CleanLockoutAccount;
9
use Artisan;
10
11
class LockoutAccountServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Register services.
15
     *
16
     * @return void
17
     */
18
    protected $commands = [
19
        'Irfa\Lockout\Console\Commands\LockCommands',
20
        'Irfa\Lockout\Console\Commands\UnlockCommands',
21
        'Irfa\Lockout\Console\Commands\AttempsCommands',
22
        'Irfa\Lockout\Console\Commands\LockInfoPackage',
23
        'Irfa\Lockout\Console\Commands\ClearLockCommands',
24
        'Irfa\Lockout\Console\Commands\CheckLockedCommands',
25
        'Irfa\Lockout\Console\Commands\TestingCommands',
26
    ];
27
28
    public function register()
29
    {
30
31
       
32
        $router = $this->app['router'];
33
        $this->commands($this->commands);
34
        if(!empty(config('irfa.lockout'))){
35
            \Illuminate\Support\Facades\Event::listen(
36
                \Illuminate\Auth\Events\Failed::class,
37
                LockoutAccount::class
38
            );
39
            \Illuminate\Support\Facades\Event::listen(
40
                \Illuminate\Auth\Events\Authenticated::class,
41
                CleanLockoutAccount::class
42
            );
43
                if(in_array('api', config('irfa.lockout.protected_middleware_group'))){
44
                    $router->pushMiddlewareToGroup('api', \Irfa\Lockout\Middleware\ApiLockAccount::class);
45
                }
46
                if(in_array('web', config('irfa.lockout.protected_middleware_group'))){
47
                        $router->pushMiddlewareToGroup('web', \Irfa\Lockout\Middleware\LockAccount::class);
48
                }
49
                if(in_array(null, config('irfa.lockout.protected_middleware_group'))){
50
                        $router->pushMiddlewareToGroup('web', \Irfa\Lockout\Middleware\LockAccount::class);
51
                }
52
        }
53
54
    }
55
56
    /**
57
     * Bootstrap services.
58
     *
59
     * @return void
60
     */
61
    public function boot()
62
    {
63
        $this->publishes([
64
            __DIR__.'/../resource/config/irfa/lockout.php' => config_path('irfa/lockout.php'), 
65
            __DIR__.'/../resource/lang' => resource_path('lang'), ], 'lockout-account');
66
67
    }
68
}
69