Skip to content

Commit f026f4a

Browse files
committed
introduce contracts for all controllers
1 parent deb2d22 commit f026f4a

File tree

59 files changed

+344
-507
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+344
-507
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
},
2121
"require-dev": {
2222
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
23-
"phpunit/phpunit": "^9.5 || ^10.5"
23+
"phpunit/phpunit": "^9.5 || ^10.5",
24+
"laravel/pint": "^1.14"
2425
},
2526
"autoload": {
2627
"psr-4": {

config/config.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
<?php
22

33
return [
4+
/*
5+
|--------------------------------------------------------------------------
6+
| Max login attempts
7+
|--------------------------------------------------------------------------
8+
|
9+
| The maximum login attempts allowed before a user gets locked out.
10+
| This is a custom configuration.
11+
|
12+
*/
13+
14+
'default_guard' => 'web_admin',
15+
416
/*
517
|--------------------------------------------------------------------------
618
| Max login attempts

src/AuthServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function boot(): void
2020
// declare publishes
2121
if ($this->app->runningInConsole()) {
2222
$this->publishes([
23-
__DIR__ . '/../config/config.php' => config_path('auth.php'),
23+
__DIR__.'/../config/config.php' => config_path('auth.php'),
2424
], 'auth-config');
2525
}
2626
}
@@ -31,7 +31,7 @@ public function boot(): void
3131
public function register(): void
3232
{
3333
// merge package config with user defined config
34-
$this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'auth');
34+
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'auth');
3535

3636
$this->app->register(EventServiceProvider::class);
3737

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Javaabu\Auth\Contracts;
4+
5+
use Illuminate\View\View;
6+
7+
interface ConfirmPasswordContract
8+
{
9+
public function getConfirmForm(): View;
10+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Javaabu\Auth\Contracts;
4+
5+
use Illuminate\Auth\Passwords\PasswordBroker;
6+
use Illuminate\View\View;
7+
8+
interface ForgotPasswordContract
9+
{
10+
public function getBroker(): PasswordBroker;
11+
12+
public function getPasswordResetForm(): View;
13+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Illuminate\Contracts\Auth\StatefulGuard;
66
use Illuminate\View\View;
77

8-
interface LoginControllerContract
8+
interface LoginContract
99
{
1010
public function getGuard(): StatefulGuard;
1111

src/Contracts/RegisterContract.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Javaabu\Auth\Contracts;
4+
5+
use Illuminate\View\View;
6+
7+
interface RegisterContract
8+
{
9+
public function showRegistrationForm(): View;
10+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Javaabu\Auth\Contracts;
4+
5+
use Illuminate\Auth\Passwords\PasswordBroker;
6+
use Illuminate\Contracts\Auth\StatefulGuard;
7+
8+
interface ResetPasswordContract
9+
{
10+
public function getBroker(): PasswordBroker;
11+
12+
public function getGuard(): StatefulGuard;
13+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Javaabu\Auth\Contracts;
4+
5+
use Illuminate\Auth\Passwords\PasswordBroker;
6+
use Illuminate\Contracts\Auth\StatefulGuard;
7+
use Illuminate\View\View;
8+
9+
interface UpdatePasswordContract
10+
{
11+
public function getGuard(): StatefulGuard;
12+
13+
public function getBroker(): PasswordBroker;
14+
15+
public function getPasswordUpdateForm(): View;
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Javaabu\Auth\Contracts;
4+
5+
interface VerificationContract
6+
{
7+
public function getEmailVerificationView();
8+
9+
public function getVerificationResultView();
10+
}

0 commit comments

Comments
 (0)