This commit is contained in:
f4ilji
2024-11-22 17:45:11 +05:00
parent b26b52bdc0
commit c3d266a6f7
9 changed files with 16 additions and 634 deletions
+1 -5
View File
@@ -12,14 +12,12 @@ use Filament\Tables\Columns\Layout\Panel;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Sanctum\HasApiTokens; use Laravel\Sanctum\HasApiTokens;
use Spatie\Permission\Traits\HasRoles; use Spatie\Permission\Traits\HasRoles;
use Vormkracht10\TwoFactorAuth\Enums\TwoFactorType;
class User extends Authenticatable implements FilamentUser class User extends Authenticatable implements FilamentUser
{ {
use HasApiTokens, HasFactory, Notifiable, HasRoles, HasPanelShield, TwoFactorAuthenticatable; use HasApiTokens, HasFactory, Notifiable, HasRoles, HasPanelShield;
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
@@ -31,7 +29,6 @@ class User extends Authenticatable implements FilamentUser
'email', 'email',
'password', 'password',
'slug', 'slug',
'two_factor_type'
]; ];
/** /**
@@ -52,7 +49,6 @@ class User extends Authenticatable implements FilamentUser
protected $casts = [ protected $casts = [
'email_verified_at' => 'datetime', 'email_verified_at' => 'datetime',
'password' => 'hashed', 'password' => 'hashed',
'two_factor_type' => TwoFactorType::class,
]; ];
public function userDetail() public function userDetail()
@@ -65,7 +65,6 @@ class AdminPanelProvider extends PanelProvider
\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make(), \BezhanSalleh\FilamentShield\FilamentShieldPlugin::make(),
FilamentSpatieLaravelBackupPlugin::make()->usingPage(Backups::class), FilamentSpatieLaravelBackupPlugin::make()->usingPage(Backups::class),
CheckpointPlugin::make(), CheckpointPlugin::make(),
TwoFactorAuthPlugin::make()->forced(),
]); ]);
} }
} }
+2 -3
View File
@@ -17,7 +17,6 @@
"inertiajs/inertia-laravel": "^1.3", "inertiajs/inertia-laravel": "^1.3",
"intervention/image": "^2.7", "intervention/image": "^2.7",
"joshembling/image-optimizer": "^1.4", "joshembling/image-optimizer": "^1.4",
"laravel/fortify": "^1.24",
"laravel/framework": "^10.10", "laravel/framework": "^10.10",
"laravel/sanctum": "^3.2", "laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8", "laravel/tinker": "^2.8",
@@ -30,8 +29,8 @@
"symfony/filesystem": "^6.3", "symfony/filesystem": "^6.3",
"tightenco/ziggy": "^1.0", "tightenco/ziggy": "^1.0",
"vkcom/vk-php-sdk": "^5.131", "vkcom/vk-php-sdk": "^5.131",
"vormkracht10/filament-2fa": "^2.0", "xvladqt/faker-lorem-flickr": "^1.0",
"xvladqt/faker-lorem-flickr": "^1.0" "ext-zip": "*"
}, },
"require-dev": { "require-dev": {
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.9.1",
Generated
+3 -370
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "f9f711e2f5b1030fd1be472f64fe1271", "content-hash": "ef31a80806504be14997f8fbefdae657",
"packages": [ "packages": [
{ {
"name": "anourvalar/eloquent-serialize", "name": "anourvalar/eloquent-serialize",
@@ -217,60 +217,6 @@
], ],
"time": "2024-09-21T17:01:40+00:00" "time": "2024-09-21T17:01:40+00:00"
}, },
{
"name": "bacon/bacon-qr-code",
"version": "v3.0.1",
"source": {
"type": "git",
"url": "https://github.com/Bacon/BaconQrCode.git",
"reference": "f9cc1f52b5a463062251d666761178dbdb6b544f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/f9cc1f52b5a463062251d666761178dbdb6b544f",
"reference": "f9cc1f52b5a463062251d666761178dbdb6b544f",
"shasum": ""
},
"require": {
"dasprid/enum": "^1.0.3",
"ext-iconv": "*",
"php": "^8.1"
},
"require-dev": {
"phly/keep-a-changelog": "^2.12",
"phpunit/phpunit": "^10.5.11 || 11.0.4",
"spatie/phpunit-snapshot-assertions": "^5.1.5",
"squizlabs/php_codesniffer": "^3.9"
},
"suggest": {
"ext-imagick": "to generate QR code images"
},
"type": "library",
"autoload": {
"psr-4": {
"BaconQrCode\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "https://dasprids.de/",
"role": "Developer"
}
],
"description": "BaconQrCode is a QR code generator for PHP.",
"homepage": "https://github.com/Bacon/BaconQrCode",
"support": {
"issues": "https://github.com/Bacon/BaconQrCode/issues",
"source": "https://github.com/Bacon/BaconQrCode/tree/v3.0.1"
},
"time": "2024-10-01T13:55:55+00:00"
},
{ {
"name": "bezhansalleh/filament-shield", "name": "bezhansalleh/filament-shield",
"version": "3.2.6", "version": "3.2.6",
@@ -876,56 +822,6 @@
], ],
"time": "2024-05-06T09:10:03+00:00" "time": "2024-05-06T09:10:03+00:00"
}, },
{
"name": "dasprid/enum",
"version": "1.0.6",
"source": {
"type": "git",
"url": "https://github.com/DASPRiD/Enum.git",
"reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8dfd07c6d2cf31c8da90c53b83c026c7696dda90",
"reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90",
"shasum": ""
},
"require": {
"php": ">=7.1 <9.0"
},
"require-dev": {
"phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11",
"squizlabs/php_codesniffer": "*"
},
"type": "library",
"autoload": {
"psr-4": {
"DASPRiD\\Enum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "https://dasprids.de/",
"role": "Developer"
}
],
"description": "PHP 7.1 enum implementation",
"keywords": [
"enum",
"map"
],
"support": {
"issues": "https://github.com/DASPRiD/Enum/issues",
"source": "https://github.com/DASPRiD/Enum/tree/1.0.6"
},
"time": "2024-08-09T14:30:48+00:00"
},
{ {
"name": "dflydev/dot-access-data", "name": "dflydev/dot-access-data",
"version": "v3.0.3", "version": "v3.0.3",
@@ -3195,71 +3091,6 @@
}, },
"time": "2024-10-06T12:28:14+00:00" "time": "2024-10-06T12:28:14+00:00"
}, },
{
"name": "laravel/fortify",
"version": "v1.24.5",
"source": {
"type": "git",
"url": "https://github.com/laravel/fortify.git",
"reference": "bba8c2ecc3fcc78e8632e0d719ae10bef6343eef"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/fortify/zipball/bba8c2ecc3fcc78e8632e0d719ae10bef6343eef",
"reference": "bba8c2ecc3fcc78e8632e0d719ae10bef6343eef",
"shasum": ""
},
"require": {
"bacon/bacon-qr-code": "^3.0",
"ext-json": "*",
"illuminate/support": "^10.0|^11.0",
"php": "^8.1",
"pragmarx/google2fa": "^8.0",
"symfony/console": "^6.0|^7.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^8.16|^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
},
"laravel": {
"providers": [
"Laravel\\Fortify\\FortifyServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Fortify\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Backend controllers and scaffolding for Laravel authentication.",
"keywords": [
"auth",
"laravel"
],
"support": {
"issues": "https://github.com/laravel/fortify/issues",
"source": "https://github.com/laravel/fortify"
},
"time": "2024-11-12T14:51:12+00:00"
},
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v10.48.24", "version": "v10.48.24",
@@ -5497,73 +5328,6 @@
], ],
"time": "2024-09-24T14:04:43+00:00" "time": "2024-09-24T14:04:43+00:00"
}, },
{
"name": "paragonie/constant_time_encoding",
"version": "v3.0.0",
"source": {
"type": "git",
"url": "https://github.com/paragonie/constant_time_encoding.git",
"reference": "df1e7fde177501eee2037dd159cf04f5f301a512"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/df1e7fde177501eee2037dd159cf04f5f301a512",
"reference": "df1e7fde177501eee2037dd159cf04f5f301a512",
"shasum": ""
},
"require": {
"php": "^8"
},
"require-dev": {
"phpunit/phpunit": "^9",
"vimeo/psalm": "^4|^5"
},
"type": "library",
"autoload": {
"psr-4": {
"ParagonIE\\ConstantTime\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com",
"role": "Maintainer"
},
{
"name": "Steve 'Sc00bz' Thomas",
"email": "steve@tobtu.com",
"homepage": "https://www.tobtu.com",
"role": "Original Developer"
}
],
"description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
"keywords": [
"base16",
"base32",
"base32_decode",
"base32_encode",
"base64",
"base64_decode",
"base64_encode",
"bin2hex",
"encoding",
"hex",
"hex2bin",
"rfc4648"
],
"support": {
"email": "info@paragonie.com",
"issues": "https://github.com/paragonie/constant_time_encoding/issues",
"source": "https://github.com/paragonie/constant_time_encoding"
},
"time": "2024-05-08T12:36:18+00:00"
},
{ {
"name": "phpdocumentor/reflection-common", "name": "phpdocumentor/reflection-common",
"version": "2.2.0", "version": "2.2.0",
@@ -5902,58 +5666,6 @@
}, },
"time": "2024-10-13T11:29:49+00:00" "time": "2024-10-13T11:29:49+00:00"
}, },
{
"name": "pragmarx/google2fa",
"version": "v8.0.3",
"source": {
"type": "git",
"url": "https://github.com/antonioribeiro/google2fa.git",
"reference": "6f8d87ebd5afbf7790bde1ffc7579c7c705e0fad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/6f8d87ebd5afbf7790bde1ffc7579c7c705e0fad",
"reference": "6f8d87ebd5afbf7790bde1ffc7579c7c705e0fad",
"shasum": ""
},
"require": {
"paragonie/constant_time_encoding": "^1.0|^2.0|^3.0",
"php": "^7.1|^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^7.5.15|^8.5|^9.0"
},
"type": "library",
"autoload": {
"psr-4": {
"PragmaRX\\Google2FA\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Antonio Carlos Ribeiro",
"email": "acr@antoniocarlosribeiro.com",
"role": "Creator & Designer"
}
],
"description": "A One Time Password Authentication package, compatible with Google Authenticator.",
"keywords": [
"2fa",
"Authentication",
"Two Factor Authentication",
"google2fa"
],
"support": {
"issues": "https://github.com/antonioribeiro/google2fa/issues",
"source": "https://github.com/antonioribeiro/google2fa/tree/v8.0.3"
},
"time": "2024-09-05T11:56:40+00:00"
},
{ {
"name": "protonemedia/laravel-cross-eloquent-search", "name": "protonemedia/laravel-cross-eloquent-search",
"version": "3.4.0", "version": "3.4.0",
@@ -11035,86 +10747,6 @@
], ],
"time": "2022-03-08T17:03:00+00:00" "time": "2022-03-08T17:03:00+00:00"
}, },
{
"name": "vormkracht10/filament-2fa",
"version": "v2.0.9",
"source": {
"type": "git",
"url": "https://github.com/vormkracht10/filament-2fa.git",
"reference": "5a9d426e61d55dec9b64d78111ff8ab1c67f8e97"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vormkracht10/filament-2fa/zipball/5a9d426e61d55dec9b64d78111ff8ab1c67f8e97",
"reference": "5a9d426e61d55dec9b64d78111ff8ab1c67f8e97",
"shasum": ""
},
"require": {
"filament/filament": "^3.0",
"filament/support": "^3.2",
"laravel/fortify": "^1.24",
"php": "^8.1",
"spatie/laravel-package-tools": "^1.15.0"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.9",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.1",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Vormkracht10\\TwoFactorAuth\\TwoFactorAuthServiceProvider"
],
"aliases": {
"TwoFactorAuth": "Vormkracht10\\TwoFactorAuth\\Facades\\TwoFactorAuth"
}
}
},
"autoload": {
"psr-4": {
"Vormkracht10\\TwoFactorAuth\\": "src/",
"Vormkracht10\\TwoFactorAuth\\Database\\Factories\\": "database/factories/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Baspa",
"email": "hello@baspa.dev",
"role": "Developer"
}
],
"description": "This package helps you integrate Laravel Fortify with ease in your Filament apps. ",
"homepage": "https://github.com/vormkracht10/filament-2fa",
"keywords": [
"filament-2fa",
"laravel",
"vormkracht10"
],
"support": {
"issues": "https://github.com/vormkracht10/filament-2fa/issues",
"source": "https://github.com/vormkracht10/filament-2fa"
},
"funding": [
{
"url": "https://github.com/vormkracht10",
"type": "github"
}
],
"time": "2024-11-14T08:59:40+00:00"
},
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
"version": "1.11.0", "version": "1.11.0",
@@ -13362,7 +12994,8 @@
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^8.1", "php": "^8.1",
"ext-curl": "*" "ext-curl": "*",
"ext-zip": "*"
}, },
"platform-dev": {}, "platform-dev": {},
"plugin-api-version": "2.6.0" "plugin-api-version": "2.6.0"
-86
View File
@@ -1,86 +0,0 @@
<?php
use Vormkracht10\TwoFactorAuth\Enums\TwoFactorType;
use Vormkracht10\TwoFactorAuth\Http\Livewire\Auth\Login;
use Vormkracht10\TwoFactorAuth\Http\Livewire\Auth\LoginTwoFactor;
use Vormkracht10\TwoFactorAuth\Http\Livewire\Auth\PasswordConfirmation;
use Vormkracht10\TwoFactorAuth\Http\Livewire\Auth\PasswordReset;
use Vormkracht10\TwoFactorAuth\Http\Livewire\Auth\Register;
use Vormkracht10\TwoFactorAuth\Http\Livewire\Auth\RequestPasswordReset;
use Vormkracht10\TwoFactorAuth\Pages\TwoFactor;
return [
/*
|--------------------------------------------------------------------------
| Two Factor Authentication
|--------------------------------------------------------------------------
|
| This value determines which two factor authentication options are available.
| Simply add or remove the options you want to use.
|
| Available options: email, phone, authenticator
|
*/
'options' => [
// TwoFactorType::authenticator,
TwoFactorType::email,
// TwoFactorType::phone,
],
'enabled_features' => [
/*
|--------------------------------------------------------------------------
| Register
|--------------------------------------------------------------------------
|
| This value determines whether users may register in the application.
|
*/
'register' => true,
/*
|--------------------------------------------------------------------------
| Tenant
|--------------------------------------------------------------------------
|
| Set to true if you're using Filament in a multi-tenant setup. If true, you
| need to manually set the user menu item for the two factor authentication
| page panel class. Take a look at the documentation for more information.
|
*/
'multi_tenancy' => false,
],
/*
|--------------------------------------------------------------------------
| SMS Service
|--------------------------------------------------------------------------
|
| To use an SMS service, you need to install the corresponding package.
| You then have to create a App\Notifications\SendOTP class that extends
| the Vormkracht10\TwoFactorAuth\Notifications\SendOTP class. After that,
| you can set the class alias in the sms_service key.
|
*/
'sms_service' => null, // For example 'vonage', 'twilio', 'nexmo', etc.
'send_otp_class' => null,
'phone_number_field' => 'phone',
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| If you want to customize the pages, you can override the used classes here.
| Make your that your classes extend the original classes.
|
*/
'login' => Login::class,
'register' => Register::class,
'challenge' => LoginTwoFactor::class,
'two_factor_settings' => TwoFactor::class,
'password_reset' => PasswordReset::class,
'password_confirmation' => PasswordConfirmation::class,
'request_password_reset' => RequestPasswordReset::class,
];
-159
View File
@@ -1,159 +0,0 @@
<?php
use Laravel\Fortify\Features;
return [
/*
|--------------------------------------------------------------------------
| Fortify Guard
|--------------------------------------------------------------------------
|
| Here you may specify which authentication guard Fortify will use while
| authenticating users. This value should correspond with one of your
| guards that is already present in your "auth" configuration file.
|
*/
'guard' => 'web',
/*
|--------------------------------------------------------------------------
| Fortify Password Broker
|--------------------------------------------------------------------------
|
| Here you may specify which password broker Fortify can use when a user
| is resetting their password. This configured value should match one
| of your password brokers setup in your "auth" configuration file.
|
*/
'passwords' => 'users',
/*
|--------------------------------------------------------------------------
| Username / Email
|--------------------------------------------------------------------------
|
| This value defines which model attribute should be considered as your
| application's "username" field. Typically, this might be the email
| address of the users but you are free to change this value here.
|
| Out of the box, Fortify expects forgot password and reset password
| requests to have a field named 'email'. If the application uses
| another name for the field you may define it below as needed.
|
*/
'username' => 'email',
'email' => 'email',
/*
|--------------------------------------------------------------------------
| Lowercase Usernames
|--------------------------------------------------------------------------
|
| This value defines whether usernames should be lowercased before saving
| them in the database, as some database system string fields are case
| sensitive. You may disable this for your application if necessary.
|
*/
'lowercase_usernames' => true,
/*
|--------------------------------------------------------------------------
| Home Path
|--------------------------------------------------------------------------
|
| Here you may configure the path where users will get redirected during
| authentication or password reset when the operations are successful
| and the user is authenticated. You are free to change this value.
|
*/
'home' => '/home',
/*
|--------------------------------------------------------------------------
| Fortify Routes Prefix / Subdomain
|--------------------------------------------------------------------------
|
| Here you may specify which prefix Fortify will assign to all the routes
| that it registers with the application. If necessary, you may change
| subdomain under which all of the Fortify routes will be available.
|
*/
'prefix' => '',
'domain' => null,
/*
|--------------------------------------------------------------------------
| Fortify Routes Middleware
|--------------------------------------------------------------------------
|
| Here you may specify which middleware Fortify will assign to the routes
| that it registers with the application. If necessary, you may change
| these middleware but typically this provided default is preferred.
|
*/
'middleware' => ['web'],
/*
|--------------------------------------------------------------------------
| Rate Limiting
|--------------------------------------------------------------------------
|
| By default, Fortify will throttle logins to five requests per minute for
| every email and IP address combination. However, if you would like to
| specify a custom rate limiter to call then you may specify it here.
|
*/
'limiters' => [
'login' => 'login',
'two-factor' => 'two-factor',
],
/*
|--------------------------------------------------------------------------
| Register View Routes
|--------------------------------------------------------------------------
|
| Here you may specify if the routes returning views should be disabled as
| you may not need them when building your own application. This may be
| especially true if you're writing a custom single-page application.
|
*/
'views' => true,
/*
|--------------------------------------------------------------------------
| Features
|--------------------------------------------------------------------------
|
| Some of the Fortify features are optional. You may disable the features
| by removing them from this array. You're free to only remove some of
| these features or you can even remove all of these if you need to.
|
*/
'features' => [
Features::registration(),
Features::resetPasswords(),
// Features::emailVerification(),
Features::updateProfileInformation(),
Features::updatePasswords(),
Features::twoFactorAuthentication([
'confirm' => true,
'confirmPassword' => true,
// 'window' => 0,
]),
],
];
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long