Skip to content

Commit

Permalink
Merge pull request #79 from frontChapter/develop
Browse files Browse the repository at this point in the history
feat: :sparkles disable dispasable emails register
  • Loading branch information
lokiwich authored Feb 25, 2024
2 parents bd75194 + f07677c commit fe53ef4
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule): void
{
$schedule->job(new ProcessFestivalSitesScore)->everyTenMinutes();
$schedule->job(new ProcessFestivalSitesScore())->everyTenMinutes();
$schedule->command('disposable:update')->daily();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Auth/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Register extends Component
])]
public string $username = '';

#[Validate('required|email|unique:users')]
#[Validate('required|email|indisposable|unique:users')]
public string $email = '';

#[Validate('required|min:6|max:40|string')]
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"livewire/livewire": "^3.0",
"marcin-orlowski/laravel-api-response-builder": "^10.0",
"predis/predis": "^2.2",
"propaganistas/laravel-disposable-email": "^2.2",
"pusher/pusher-php-server": "^7.2",
"remzikocak/laravel-gravatar": "^2.0",
"simplesoftwareio/simple-qrcode": "^4.2",
Expand Down
77 changes: 76 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions config/disposable-email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| JSON Source URLs
|--------------------------------------------------------------------------
|
| The source URLs yielding a list of disposable email domains. Change these
| to whatever source you like. Just make sure they all return a JSON array.
|
| A sensible default is provided using jsDelivr's services. jsDelivr is
| a free service, so there are no uptime or support guarantees.
|
*/

'sources' => [
'https://cdn.jsdelivr.net/gh/disposable/disposable-email-domains@master/domains.json'
],

/*
|--------------------------------------------------------------------------
| Fetch class
|--------------------------------------------------------------------------
|
| The class responsible for fetching the contents of the source url.
| The default implementation makes use of file_get_contents and
| json_decode and will probably suffice for most applications.
|
| If your application has different needs (e.g. behind a proxy) then you
| can define a custom fetch class here that carries out the fetching.
| Your custom class should implement the Fetcher contract.
|
*/

'fetcher' => \Propaganistas\LaravelDisposableEmail\Fetcher\DefaultFetcher::class,

/*
|--------------------------------------------------------------------------
| Storage Path
|--------------------------------------------------------------------------
|
| The location where the retrieved domains list should be stored locally.
| The path should be accessible and writable by the web server. A good
| place for storing the list is in the framework's own storage path.
|
*/

'storage' => storage_path('framework/disposable_domains.json'),

/*
|--------------------------------------------------------------------------
| Cache Configuration
|--------------------------------------------------------------------------
|
| Here you may define whether the disposable domains list should be cached.
| If you disable caching or when the cache is empty, the list will be
| fetched from local storage instead.
|
| You can optionally specify an alternate cache connection or modify the
| cache key as desired.
|
*/

'cache' => [
'enabled' => true,
'store' => 'default',
'key' => 'disposable_email:domains',
],

];
2 changes: 2 additions & 0 deletions lang/fa/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
'jdatetime_before' => ':attribute باید قبل از :date باشد.',
'jdatetime_before_equal' => ':attribute باید قبل یا برابر از :date باشد.',

'indisposable' => ':attribute یک‌بار مصرف مورد قبول نیست.',

'attributes' => [
'start_date' => 'تاریخ شروع',
'expire_datetime' => 'تاریخ انقضا',
Expand Down
1 change: 1 addition & 0 deletions storage/framework/disposable_domains.json

Large diffs are not rendered by default.

0 comments on commit fe53ef4

Please sign in to comment.