From 50ab64675dda19c92078918e54b906f0cebf0041 Mon Sep 17 00:00:00 2001 From: mohamadreza Date: Mon, 16 Sep 2024 12:01:33 +0330 Subject: [PATCH 01/20] feat(code history): add code history chart --- .idea/workspace.xml | 2 +- .../Controllers/Admin/DashboardController.php | 9 ++- resources/views/admin/dashboard.blade.php | 67 +++++++++++++++++++ 3 files changed, 74 insertions(+), 4 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index aba187c..44d16a2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -233,7 +233,7 @@ - + diff --git a/app/Http/Controllers/Admin/DashboardController.php b/app/Http/Controllers/Admin/DashboardController.php index 64fc713..8fd3c3d 100644 --- a/app/Http/Controllers/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/DashboardController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; +use App\Models\Code; use App\Models\User; use Carbon\Carbon; @@ -10,9 +11,9 @@ class DashboardController extends Controller { public function index() { - function getUsers($day) + function GetTables($day, $model) { - $data = User::where('created_at', '>=', Carbon::now()->subDays($day)) + $data = $model::where('created_at', '>=', Carbon::now()->subDays($day)) ->selectRaw('DATE(created_at) as date, COUNT(*) as total') ->groupBy('date') ->orderBy('date', 'ASC') @@ -27,10 +28,12 @@ function getUsers($day) ]; } - $users_history = getUsers(10); + $users_history = GetTables(10, User::class); + $codes_history = GetTables(10, Code::class); return view('admin.dashboard', [ 'users_history' => $users_history, + 'codes_history' => $codes_history, ]); } } diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index c889723..ced8339 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -11,6 +11,15 @@
+
+
+
+
تعداد کد ها
+

{{ array_sum($codes_history["totals"]) }}

+
+
+
+
@@ -78,6 +87,64 @@ show: false, }, })).render(); + + window.ApexCharts && (new ApexCharts(document.getElementById('small_chart_2'), { + chart: { + type: "area", + fontFamily: 'inherit', + height: 70.0, + sparkline: { + enabled: true + }, + animations: { + enabled: true + }, + }, + dataLabels: { + enabled: false, + }, + fill: { + opacity: .16, + type: 'solid' + }, + stroke: { + width: 2, + lineCap: "round", + curve: "smooth", + }, + series: [{ + name: "تعداد", + data: @json($codes_history["totals"]) + }], + tooltip: { + theme: 'dark' + }, + grid: { + strokeDashArray: 4, + }, + xaxis: { + labels: { + padding: 0, + }, + tooltip: { + enabled: false + }, + axisBorder: { + show: false, + }, + type: 'datetime', + }, + yaxis: { + labels: { + padding: 4 + }, + }, + labels: @json($codes_history["dates"]), + colors: ["#FF5C00"], + legend: { + show: false, + }, + })).render(); }); @endsection From 935e4a40d1993cbe4d0be1b3456739ad8ccb89fe Mon Sep 17 00:00:00 2001 From: mohamadreza Date: Mon, 16 Sep 2024 12:06:43 +0330 Subject: [PATCH 02/20] feat(codes_visit history): add codes_visit history chart --- .idea/workspace.xml | 3 +- .../Controllers/Admin/DashboardController.php | 3 + resources/views/admin/dashboard.blade.php | 67 +++++++++++++++++++ 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 44d16a2..1261739 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,7 +5,6 @@ - @@ -233,7 +232,7 @@ - + diff --git a/app/Http/Controllers/Admin/DashboardController.php b/app/Http/Controllers/Admin/DashboardController.php index 8fd3c3d..01ecacf 100644 --- a/app/Http/Controllers/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/DashboardController.php @@ -4,6 +4,7 @@ use App\Http\Controllers\Controller; use App\Models\Code; +use App\Models\CodesVisit; use App\Models\User; use Carbon\Carbon; @@ -30,10 +31,12 @@ function GetTables($day, $model) $users_history = GetTables(10, User::class); $codes_history = GetTables(10, Code::class); + $codes_visits_history = GetTables(10, CodesVisit::class); return view('admin.dashboard', [ 'users_history' => $users_history, 'codes_history' => $codes_history, + 'codes_visits_history' => $codes_visits_history, ]); } } diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index ced8339..a98fd3c 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -20,6 +20,15 @@
+
+
+
+
تعداد بازدید از کد ها
+

{{ array_sum($codes_visits_history["totals"]) }}

+
+
+
+
@@ -145,6 +154,64 @@ show: false, }, })).render(); + + window.ApexCharts && (new ApexCharts(document.getElementById('small_chart_3'), { + chart: { + type: "area", + fontFamily: 'inherit', + height: 70.0, + sparkline: { + enabled: true + }, + animations: { + enabled: true + }, + }, + dataLabels: { + enabled: false, + }, + fill: { + opacity: .16, + type: 'solid' + }, + stroke: { + width: 2, + lineCap: "round", + curve: "smooth", + }, + series: [{ + name: "تعداد", + data: @json($codes_visits_history["totals"]) + }], + tooltip: { + theme: 'dark' + }, + grid: { + strokeDashArray: 4, + }, + xaxis: { + labels: { + padding: 0, + }, + tooltip: { + enabled: false + }, + axisBorder: { + show: false, + }, + type: 'datetime', + }, + yaxis: { + labels: { + padding: 4 + }, + }, + labels: @json($codes_visits_history["dates"]), + colors: ["#FF5C00"], + legend: { + show: false, + }, + })).render(); }); @endsection From c90479d47da2eb51fdc3f24ffc7c118c05a9b696 Mon Sep 17 00:00:00 2001 From: mohamadreza Date: Mon, 16 Sep 2024 12:29:39 +0330 Subject: [PATCH 03/20] fix(users): fix all users get bug --- .idea/workspace.xml | 7 ++++--- app/DataTables/User/CodeDataTable.php | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1261739..5be54ae 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,8 +5,9 @@ - - + + + diff --git a/app/DataTables/User/CodeDataTable.php b/app/DataTables/User/CodeDataTable.php index 33b033c..a14e61e 100644 --- a/app/DataTables/User/CodeDataTable.php +++ b/app/DataTables/User/CodeDataTable.php @@ -42,7 +42,7 @@ public function dataTable(QueryBuilder $query): EloquentDataTable public function query(Code $model): QueryBuilder { - return $model->newQuery()->where('user_id', auth()->user()->first()->id); + return $model->newQuery()->where('user_id', auth()->user()->id); } public function html(): HtmlBuilder @@ -61,6 +61,7 @@ public function getColumns(): array return [ Column::make('id')->title('ایدی'), Column::make('title')->title('عنوان'), + Column::make('user_id')->title('user'), Column::make('code')->title('کد'), Column::make('created_at')->title('ایجاد شده در'), Column::make('action')->title('کاربردی'), From d0c2972bb96b39f9c9051ac89804ab0b8c0fe7b5 Mon Sep 17 00:00:00 2001 From: mohamadreza Date: Mon, 16 Sep 2024 13:08:26 +0330 Subject: [PATCH 04/20] feat(migrate): create site visit table --- .idea/workspace.xml | 6 ++-- app/Http/Controllers/DashboardController.php | 1 + app/Models/Visit.php | 11 +++++++ .../2024_09_16_093504_create_visits_table.php | 29 +++++++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 app/Models/Visit.php create mode 100644 database/migrations/2024_09_16_093504_create_visits_table.php diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5be54ae..a8a5497 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,8 +6,8 @@ - - + + diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 73b2a25..b495330 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -4,6 +4,7 @@ use App\Models\Code; use App\Models\CodesVisit; +use App\Models\Session; use Carbon\Carbon; class DashboardController extends Controller diff --git a/app/Models/Visit.php b/app/Models/Visit.php new file mode 100644 index 0000000..29f0ff3 --- /dev/null +++ b/app/Models/Visit.php @@ -0,0 +1,11 @@ +id(); + $table->string('user_ip'); + $table->string('user_agent'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('visits'); + } +}; From 48e0d7fa32c83873dbd6b79cd5a071fcef290167 Mon Sep 17 00:00:00 2001 From: mohamadreza Date: Mon, 16 Sep 2024 13:29:15 +0330 Subject: [PATCH 05/20] feat(imap): add imap package --- .idea/workspace.xml | 4 +- composer.json | 1 + composer.lock | 160 ++++++++++++++++++++++++++++++- config/imap.php | 226 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 387 insertions(+), 4 deletions(-) create mode 100644 config/imap.php diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a8a5497..5914b74 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,8 +6,6 @@ - - diff --git a/composer.json b/composer.json index c0e6a3d..70031ae 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9", "morilog/jalali": "^3.4", + "webklex/laravel-imap": "^4.1", "yajra/laravel-datatables": "^11.0", "yajra/laravel-datatables-oracle": "11.0" }, diff --git a/composer.lock b/composer.lock index 2e67a9c..075cec5 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "8da169d5c35b202f5ec0191d36956a95", + "content-hash": "d809b1465c18c8ab39c38d9e20211199", "packages": [ { "name": "archtechx/enums", @@ -7294,6 +7294,164 @@ ], "time": "2022-03-08T17:03:00+00:00" }, + { + "name": "webklex/laravel-imap", + "version": "4.1.2", + "source": { + "type": "git", + "url": "https://github.com/Webklex/laravel-imap.git", + "reference": "9038139b8789e60c998eb389d419d41b969f2713" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Webklex/laravel-imap/zipball/9038139b8789e60c998eb389d419d41b969f2713", + "reference": "9038139b8789e60c998eb389d419d41b969f2713", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "ext-iconv": "*", + "ext-mbstring": "*", + "laravel/framework": ">=5.0.0", + "php": ">=5.5.9", + "webklex/php-imap": "^4.1.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "laravel": { + "providers": [ + "Webklex\\IMAP\\Providers\\LaravelServiceProvider" + ], + "aliases": { + "Client": "Webklex\\IMAP\\Facades\\Client" + } + } + }, + "autoload": { + "psr-4": { + "Webklex\\IMAP\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Malte Goldenbaum", + "email": "github@webklex.com", + "role": "Developer" + } + ], + "description": "Laravel IMAP client", + "homepage": "https://github.com/webklex/laravel-imap", + "keywords": [ + "idle", + "imap", + "laravel", + "laravel-imap", + "mail", + "oauth", + "pop3", + "webklex" + ], + "support": { + "issues": "https://github.com/Webklex/laravel-imap/issues", + "source": "https://github.com/Webklex/laravel-imap/tree/4.1.2" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/webklex", + "type": "custom" + }, + { + "url": "https://ko-fi.com/webklex", + "type": "ko_fi" + } + ], + "time": "2023-01-18T18:33:20+00:00" + }, + { + "name": "webklex/php-imap", + "version": "4.1.2", + "source": { + "type": "git", + "url": "https://github.com/Webklex/php-imap.git", + "reference": "94bf93ae8868ac1e073cfbaef377f0ca1acac2bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Webklex/php-imap/zipball/94bf93ae8868ac1e073cfbaef377f0ca1acac2bc", + "reference": "94bf93ae8868ac1e073cfbaef377f0ca1acac2bc", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "illuminate/pagination": ">=5.0.0", + "nesbot/carbon": ">=1.0", + "php": ">=7.0.0", + "symfony/http-foundation": ">=2.8.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "symfony/mime": "Recomended for better extension support" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webklex\\PHPIMAP\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Malte Goldenbaum", + "email": "github@webklex.com", + "role": "Developer" + } + ], + "description": "PHP IMAP client", + "homepage": "https://github.com/webklex/php-imap", + "keywords": [ + "imap", + "mail", + "php-imap", + "pop3", + "webklex" + ], + "support": { + "issues": "https://github.com/Webklex/php-imap/issues", + "source": "https://github.com/Webklex/php-imap/tree/4.1.2" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/webklex", + "type": "custom" + }, + { + "url": "https://ko-fi.com/webklex", + "type": "ko_fi" + } + ], + "time": "2022-12-14T15:45:15+00:00" + }, { "name": "webmozart/assert", "version": "1.11.0", diff --git a/config/imap.php b/config/imap.php new file mode 100644 index 0000000..a509ccc --- /dev/null +++ b/config/imap.php @@ -0,0 +1,226 @@ + env('IMAP_DEFAULT_ACCOUNT', 'default'), + + /* + |-------------------------------------------------------------------------- + | Default date format + |-------------------------------------------------------------------------- + | + | The default date format is used to convert any given Carbon::class object into a valid date string. + | These are currently known working formats: "d-M-Y", "d-M-y", "d M y" + | + */ + 'date_format' => 'd-M-Y', + + /* + |-------------------------------------------------------------------------- + | Available IMAP accounts + |-------------------------------------------------------------------------- + | + | Please list all IMAP accounts which you are planning to use within the + | array below. + | + */ + 'accounts' => [ + + 'default' => [// account identifier + 'host' => env('IMAP_HOST', 'localhost'), + 'port' => env('IMAP_PORT', 993), + 'protocol' => env('IMAP_PROTOCOL', 'imap'), //might also use imap, [pop3 or nntp (untested)] + 'encryption' => env('IMAP_ENCRYPTION', 'ssl'), // Supported: false, 'ssl', 'tls', 'notls', 'starttls' + 'validate_cert' => env('IMAP_VALIDATE_CERT', true), + 'username' => env('IMAP_USERNAME', 'root@example.com'), + 'password' => env('IMAP_PASSWORD', ''), + 'authentication' => env('IMAP_AUTHENTICATION', null), + 'proxy' => [ + 'socket' => null, + 'request_fulluri' => false, + 'username' => null, + 'password' => null, + ], + "timeout" => 30, + "extensions" => [] + ], + + /* + 'gmail' => [ // account identifier + 'host' => 'imap.gmail.com', + 'port' => 993, + 'encryption' => 'ssl', + 'validate_cert' => true, + 'username' => 'example@gmail.com', + 'password' => 'PASSWORD', + 'authentication' => 'oauth', + ], + + 'another' => [ // account identifier + 'host' => '', + 'port' => 993, + 'encryption' => false, + 'validate_cert' => true, + 'username' => '', + 'password' => '', + 'authentication' => null, + ] + */ + ], + + /* + |-------------------------------------------------------------------------- + | Available IMAP options + |-------------------------------------------------------------------------- + | + | Available php imap config parameters are listed below + | -Delimiter (optional): + | This option is only used when calling $oClient-> + | You can use any supported char such as ".", "/", (...) + | -Fetch option: + | IMAP::FT_UID - Message marked as read by fetching the body message + | IMAP::FT_PEEK - Fetch the message without setting the "seen" flag + | -Fetch sequence id: + | IMAP::ST_UID - Fetch message components using the message uid + | IMAP::ST_MSGN - Fetch message components using the message number + | -Body download option + | Default TRUE + | -Flag download option + | Default TRUE + | -Soft fail + | Default FALSE - Set to TRUE if you want to ignore certain exception while fetching bulk messages + | -RFC822 + | Default TRUE - Set to FALSE to prevent the usage of \imap_rfc822_parse_headers(). + | See https://github.com/Webklex/php-imap/issues/115 for more information. + | -Debug enable to trace communication traffic + | -UID cache enable the UID cache + | -Fallback date is used if the given message date could not be parsed + | -Boundary regex used to detect message boundaries. If you are having problems with empty messages, missing + | attachments or anything like this. Be advised that it likes to break which causes new problems.. + | -Message key identifier option + | You can choose between the following: + | 'id' - Use the MessageID as array key (default, might cause hickups with yahoo mail) + | 'number' - Use the message number as array key (isn't always unique and can cause some interesting behavior) + | 'list' - Use the message list number as array key (incrementing integer (does not always start at 0 or 1) + | 'uid' - Use the message uid as array key (isn't always unique and can cause some interesting behavior) + | -Fetch order + | 'asc' - Order all messages ascending (probably results in oldest first) + | 'desc' - Order all messages descending (probably results in newest first) + | -Disposition types potentially considered an attachment + | Default ['attachment', 'inline'] + | -Common folders + | Default folder locations and paths assumed if none is provided + | -Open IMAP options: + | DISABLE_AUTHENTICATOR - Disable authentication properties. + | Use 'GSSAPI' if you encounter the following + | error: "Kerberos error: No credentials cache + | file found (try running kinit) (...)" + | or ['GSSAPI','PLAIN'] if you are using outlook mail + | -Decoder options (currently only the message subject and attachment name decoder can be set) + | 'utf-8' - Uses imap_utf8($string) to decode a string + | 'mimeheader' - Uses mb_decode_mimeheader($string) to decode a string + | + */ + 'options' => [ + 'delimiter' => '/', + 'fetch' => \Webklex\PHPIMAP\IMAP::FT_PEEK, + 'sequence' => \Webklex\PHPIMAP\IMAP::ST_UID, + 'fetch_body' => true, + 'fetch_flags' => true, + 'soft_fail' => false, + 'rfc822' => true, + 'debug' => false, + 'uid_cache' => true, + // 'fallback_date' => "01.01.1970 00:00:00", + 'boundary' => '/boundary=(.*?(?=;)|(.*))/i', + 'message_key' => 'list', + 'fetch_order' => 'asc', + 'dispositions' => ['attachment', 'inline'], + 'common_folders' => [ + "root" => "INBOX", + "junk" => "INBOX/Junk", + "draft" => "INBOX/Drafts", + "sent" => "INBOX/Sent", + "trash" => "INBOX/Trash", + ], + 'decoder' => [ + 'message' => 'utf-8', // mimeheader + 'attachment' => 'utf-8' // mimeheader + ], + 'open' => [ + // 'DISABLE_AUTHENTICATOR' => 'GSSAPI' + ] + ], + + /* + |-------------------------------------------------------------------------- + | Available flags + |-------------------------------------------------------------------------- + | + | List all available / supported flags. Set to null to accept all given flags. + */ + 'flags' => ['recent', 'flagged', 'answered', 'deleted', 'seen', 'draft'], + + /* + |-------------------------------------------------------------------------- + | Available events + |-------------------------------------------------------------------------- + | + */ + 'events' => [ + "message" => [ + 'new' => \Webklex\IMAP\Events\MessageNewEvent::class, + 'moved' => \Webklex\IMAP\Events\MessageMovedEvent::class, + 'copied' => \Webklex\IMAP\Events\MessageCopiedEvent::class, + 'deleted' => \Webklex\IMAP\Events\MessageDeletedEvent::class, + 'restored' => \Webklex\IMAP\Events\MessageRestoredEvent::class, + ], + "folder" => [ + 'new' => \Webklex\IMAP\Events\FolderNewEvent::class, + 'moved' => \Webklex\IMAP\Events\FolderMovedEvent::class, + 'deleted' => \Webklex\IMAP\Events\FolderDeletedEvent::class, + ], + "flag" => [ + 'new' => \Webklex\IMAP\Events\FlagNewEvent::class, + 'deleted' => \Webklex\IMAP\Events\FlagDeletedEvent::class, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Available masking options + |-------------------------------------------------------------------------- + | + | By using your own custom masks you can implement your own methods for + | a better and faster access and less code to write. + | + | Checkout the two examples custom_attachment_mask and custom_message_mask + | for a quick start. + | + | The provided masks below are used as the default masks. + */ + 'masks' => [ + 'message' => \Webklex\PHPIMAP\Support\Masks\MessageMask::class, + 'attachment' => \Webklex\PHPIMAP\Support\Masks\AttachmentMask::class + ] +]; From 025855d7749b7772764ffd6199d9718535a0cc03 Mon Sep 17 00:00:00 2001 From: mohamadreza Date: Mon, 16 Sep 2024 13:49:29 +0330 Subject: [PATCH 06/20] feat(imap): config imap --- .idea/workspace.xml | 6 +++++- .../EmailVerificationNotificationController.php | 16 ++++++++++++++++ config/imap.php | 10 +++++----- resources/views/auth/verify-email.blade.php | 14 ++++++++++---- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5914b74..2e19e63 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,6 +6,8 @@ + + { @@ -231,7 +235,7 @@ - + diff --git a/app/Http/Controllers/Auth/EmailVerificationNotificationController.php b/app/Http/Controllers/Auth/EmailVerificationNotificationController.php index 044fc70..2084502 100644 --- a/app/Http/Controllers/Auth/EmailVerificationNotificationController.php +++ b/app/Http/Controllers/Auth/EmailVerificationNotificationController.php @@ -5,6 +5,7 @@ use App\Http\Controllers\Controller; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; +use Webklex\IMAP\Facades\Client; class EmailVerificationNotificationController extends Controller { @@ -19,6 +20,21 @@ public function store(Request $request): RedirectResponse $request->user()->sendEmailVerificationNotification(); + $client = Client::account('default'); + $client->connect(); + + $inbox = $client->getFolder('INBOX'); + $messages = $inbox->messages()->all()->get(); + + if ($messages->count() > 0) { + $message = $messages->last(); + if ($message = "Mail delivery failed: returning message to sender"){ + return back()->with('status', 'verification-link-fail'); + } + } else { + return back()->with('status', 'verification-link-fail'); + } + return back()->with('status', 'verification-link-sent'); } } diff --git a/config/imap.php b/config/imap.php index a509ccc..d0bc60c 100644 --- a/config/imap.php +++ b/config/imap.php @@ -47,13 +47,13 @@ 'accounts' => [ 'default' => [// account identifier - 'host' => env('IMAP_HOST', 'localhost'), + 'host' => env('IMAP_HOST', 'mail.vestaydesign.com'), 'port' => env('IMAP_PORT', 993), - 'protocol' => env('IMAP_PROTOCOL', 'imap'), //might also use imap, [pop3 or nntp (untested)] - 'encryption' => env('IMAP_ENCRYPTION', 'ssl'), // Supported: false, 'ssl', 'tls', 'notls', 'starttls' + 'protocol' => env('IMAP_PROTOCOL', 'imap'), + 'encryption' => env('IMAP_ENCRYPTION', 'ssl'), 'validate_cert' => env('IMAP_VALIDATE_CERT', true), - 'username' => env('IMAP_USERNAME', 'root@example.com'), - 'password' => env('IMAP_PASSWORD', ''), + 'username' => env('IMAP_USERNAME', 'salam@vestaydesign.com'), + 'password' => env('IMAP_PASSWORD', '22$O-7!epgu-22$O-7!epgu-22$O-7!epgu-'), 'authentication' => env('IMAP_AUTHENTICATION', null), 'proxy' => [ 'socket' => null, diff --git a/resources/views/auth/verify-email.blade.php b/resources/views/auth/verify-email.blade.php index 9b8340d..4e49dae 100644 --- a/resources/views/auth/verify-email.blade.php +++ b/resources/views/auth/verify-email.blade.php @@ -3,10 +3,16 @@ {{ __('Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn\'t receive the email, we will gladly send you another.') }} - @if (session('status') == 'verification-link-sent') -
- {{ __('A new verification link has been sent to the email address you provided during registration.') }} -
+ @if(session('status')) + @if (session('status') == 'verification-link-sent') +
+ {{ __('A new verification link has been sent to the email address you provided during registration.') }} +
+ @else +
+ {{ __('در ارسال ایمیل مشکلی پیش امده است. احتمالا به حد اکثر ارسال ایمیل رسیده اید.') }} +
+ @endif @endif
@csrf From d863a0260ce55556926c4d19b905f96bad87a0b4 Mon Sep 17 00:00:00 2001 From: mohamadreza Date: Mon, 16 Sep 2024 14:00:31 +0330 Subject: [PATCH 07/20] feat(email): add emiail table --- .idea/workspace.xml | 3 +- app/Models/Email.php | 11 +++++++ .../2024_09_16_102554_create_emails_table.php | 29 +++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 app/Models/Email.php create mode 100644 database/migrations/2024_09_16_102554_create_emails_table.php diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2e19e63..5168c19 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,7 +7,6 @@ -