-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from simonhamp/feature/password-hashing
Feature/password hashing
- Loading branch information
Showing
7 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"/js/tool.js": "/js/tool.js", | ||
"/css/tool.css": "/css/tool.css" | ||
"/js/tool.js": "/js/tool.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace SimonHamp\LaravelNovaCsvImport\Modifiers; | ||
|
||
use Illuminate\Support\Facades\Hash; | ||
use SimonHamp\LaravelNovaCsvImport\Contracts\Modifier; | ||
use Illuminate\Support\Str; | ||
|
||
class Password implements Modifier | ||
{ | ||
public function title(): string | ||
{ | ||
return 'Password hash value'; | ||
} | ||
|
||
public function description(): string | ||
{ | ||
return 'Treat the the value as a password and securely hash it using the chosen hashing algorithm.<br> | ||
Your default hashing algorithm is: <b>'. Hash::getDefaultDriver() . '</b>'; | ||
} | ||
|
||
public function settings(): array | ||
{ | ||
return [ | ||
'algorithm' => [ | ||
'type' => 'select', | ||
'options' => [ | ||
'bcrypt', | ||
'argon', | ||
'argon2id' | ||
], | ||
'help' => 'See the <a href="https://laravel.com/docs/hashing" target="_blank">Laravel documentation</a> | ||
for more info on password hashing', | ||
], | ||
]; | ||
} | ||
|
||
public function handle($value = null, array $settings = []): string | ||
{ | ||
return Hash::driver($settings['algorithm'])->make($value); | ||
} | ||
} |