Use built-in functions

This commit is contained in:
DariusIII
2024-04-10 22:16:55 +02:00
parent 9521ccb54e
commit b98dbe1a10
4 changed files with 4 additions and 63 deletions
@@ -9,6 +9,7 @@ use App\Models\User;
use DariusIII\Token\Facades\Token;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
class ForgotPasswordController extends Controller
{
@@ -62,7 +63,7 @@ class ForgotPasswordController extends Controller
//
// Generate a forgottenpassword guid, store it in the user table
//
$guid = Token::random(32);
$guid = Str::random(32);
User::updatePassResetGuid($ret['id'], $guid);
//
// Send the email
+1 -1
View File
@@ -528,7 +528,7 @@ class User extends Authenticatable
*/
public static function generatePassword(int $length = 15): string
{
return Token::random($length, true);
return Str::password($length);
}
/**
-1
View File
@@ -53,7 +53,6 @@
"dariusiii/php-itunes-api": "^1.0",
"dariusiii/rarinfo": "^2.7",
"dariusiii/tmdb-laravel": "^6.0",
"dariusiii/token": "^5.0",
"dborsatto/php-giantbomb": "^2.2",
"divineomega/php-cli-progress-bar": "^2.1",
"doctrine/dbal": "^3.8",
Generated
+1 -60
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5ab151a8fea6ff561d73c3e3c25e6cc8",
"content-hash": "01624044ef88773d39b2631f4d9375f5",
"packages": [
{
"name": "aharen/omdbapi",
@@ -1079,65 +1079,6 @@
},
"time": "2023-11-29T11:33:57+00:00"
},
{
"name": "dariusiii/token",
"version": "v5.0.0",
"source": {
"type": "git",
"url": "https://github.com/DariusIII/laravel-token.git",
"reference": "713cdffe185e4dab26d6a79ae4663cc8329df18b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/DariusIII/laravel-token/zipball/713cdffe185e4dab26d6a79ae4663cc8329df18b",
"reference": "713cdffe185e4dab26d6a79ae4663cc8329df18b",
"shasum": ""
},
"require": {
"illuminate/support": "^8.0|^9.0|^10.0",
"php": ">=8.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"DariusIII\\Token\\TokenServiceProvider"
],
"aliases": {
"Token": "DariusIII\\Token\\Facades\\Token"
}
}
},
"autoload": {
"psr-4": {
"DariusIII\\Token\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "MustafaKhaled",
"email": "MustafaKhaled.dev@gmail.com"
}
],
"description": "Unique Token Generator For Laravel",
"keywords": [
"PHP token",
"generate",
"laravel",
"laravel token",
"token",
"token generator",
"unique token"
],
"support": {
"source": "https://github.com/DariusIII/laravel-token/tree/v5.0.0"
},
"time": "2023-02-16T17:40:32+00:00"
},
{
"name": "dasprid/enum",
"version": "1.0.5",