From 52212527b2ea52f3927ba8a778fa1a3ecbbbb87b Mon Sep 17 00:00:00 2001 From: ReeceM Date: Wed, 9 Feb 2022 20:59:56 +0200 Subject: [PATCH 1/7] remove upstream changelog data --- changelog.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/changelog.md b/changelog.md index 2a27402..71afdcc 100644 --- a/changelog.md +++ b/changelog.md @@ -265,9 +265,3 @@ New Structure: ### Fixes - Fixes an issue where in some cases Faker data would cause a issue for the javascript frontend. See #187 and #188 - -## Version 4.0.0 - -### Changed - -Laravel 9 Support From b2db45432e9f3230accf171ba8fe37b70cdb9e26 Mon Sep 17 00:00:00 2001 From: ReeceM Date: Wed, 9 Feb 2022 22:28:24 +0200 Subject: [PATCH 2/7] feat: use the subject in the table --- resources/views/sections/mailables.blade.php | 4 ++-- .../views/sections/view-mailable.blade.php | 22 ++++++++++++------- src/MailEclipse.php | 4 +++- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/resources/views/sections/mailables.blade.php b/resources/views/sections/mailables.blade.php index cb527e2..fbc4f86 100644 --- a/resources/views/sections/mailables.blade.php +++ b/resources/views/sections/mailables.blade.php @@ -31,7 +31,7 @@ {{ __('Name') }} - {{ __('Namespace') }} + {{ __('Subject') }} {{ __('Last edited') }} @@ -42,7 +42,7 @@ {{ $mailable['name'] }} - {{ $mailable['namespace'] }} + {{ $mailable['subject'] }} {{ (\Carbon\Carbon::createFromTimeStamp($mailable['modified']))->diffForHumans() }} diff --git a/resources/views/sections/view-mailable.blade.php b/resources/views/sections/view-mailable.blade.php index 8438cb2..74c3c14 100644 --- a/resources/views/sections/view-mailable.blade.php +++ b/resources/views/sections/view-mailable.blade.php @@ -32,14 +32,20 @@ - @if ( !empty($resource['data']->subject) ) - - Subject - - {{ $resource['data']->subject }} - - - @endif + + Subject + @if ( empty($resource['data']->subject) ) + + No Subject Set, The default Namespace will be used. See Custom the subject + + @else + + {{ $resource['data']->subject }} + + + @endif + + @if ( !empty($resource['data']->locale) ) diff --git a/src/MailEclipse.php b/src/MailEclipse.php index 0a906ae..695a608 100644 --- a/src/MailEclipse.php +++ b/src/MailEclipse.php @@ -29,7 +29,7 @@ class MailEclipse { public const VIEW_NAMESPACE = 'maileclipse'; - public const VERSION = '3.5.0'; + public const VERSION = '3.5.2'; /** * Default type examples for being passed to reflected classes. @@ -514,6 +514,8 @@ protected static function mailablesList() $fqcns[$i]['markdown'] = self::getMarkdownViewName($mailable_data); $fqcns[$i]['name'] = $name; $fqcns[$i]['namespace'] = $mailableClass; + /** @see \Illuminate\Mail\Mailable@buildSubject for the Str Functions, used to keep consistent. */ + $fqcns[$i]['subject'] = $mailable_data->subject ?? Str::title(Str::snake(class_basename($mailableClass), ' ')); $fqcns[$i]['filename'] = $phpFile->getFilename(); $fqcns[$i]['modified'] = $phpFile->getCTime(); $fqcns[$i]['viewed'] = $phpFile->getATime(); From 978b140a54fd50607af2f72fafc5defe97a60431 Mon Sep 17 00:00:00 2001 From: ReeceM Date: Wed, 9 Feb 2022 22:28:29 +0200 Subject: [PATCH 3/7] update changelog --- changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.md b/changelog.md index 71afdcc..25d74dd 100644 --- a/changelog.md +++ b/changelog.md @@ -265,3 +265,9 @@ New Structure: ### Fixes - Fixes an issue where in some cases Faker data would cause a issue for the javascript frontend. See #187 and #188 + + +## Version 3.5.2 + +### Changes +- Adds the subject of the email client to the table instead of the namespace. See #79 From cb751c28ccb3a20fd371b11fd51302d14961102f Mon Sep 17 00:00:00 2001 From: ReeceM Date: Wed, 9 Feb 2022 22:29:33 +0200 Subject: [PATCH 4/7] change composer to v3 deps --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 22f55a1..cc4eab4 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,14 @@ "markdown" ], "require": { - "illuminate/support": "^9.0", + "illuminate/support": "^8.0", "reecem/mocker": "^1.1", - "laravel/legacy-factories": "^1.3" + "laravel/legacy-factories": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^9.5.10", - "mockery/mockery": "^1.4.4", - "orchestra/testbench": "^7.0", + "phpunit/phpunit": "^8.0|^9.0", + "mockery/mockery": "~1.2", + "orchestra/testbench": "^6.0", "sempro/phpunit-pretty-print": "^1.0" }, "autoload": { From 4251ad5bce582e2ebf9e3421a0b1598c4fc08fb8 Mon Sep 17 00:00:00 2001 From: ReeceM Date: Thu, 10 Feb 2022 22:19:02 +0200 Subject: [PATCH 5/7] use config option to enable behaviour --- config/maileclipse.php | 12 ++++++++++++ resources/views/sections/mailables.blade.php | 4 ++-- src/MailEclipse.php | 5 +++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config/maileclipse.php b/config/maileclipse.php index 74d8cc9..dcf217e 100644 --- a/config/maileclipse.php +++ b/config/maileclipse.php @@ -32,6 +32,18 @@ 'factory' => true, + /* + |-------------------------------------------------------------------------- + | Display Mailable Subject + |-------------------------------------------------------------------------- + | + | Set to true this will display the subject of the Mailable instead of Class Name. + | When the config setting is false the namespace/class name is shown + | options: true / false + | + */ + 'display_as_subject' => true, + /* |-------------------------------------------------------------------------- | Relationship loading. diff --git a/resources/views/sections/mailables.blade.php b/resources/views/sections/mailables.blade.php index fbc4f86..f68b1ce 100644 --- a/resources/views/sections/mailables.blade.php +++ b/resources/views/sections/mailables.blade.php @@ -31,7 +31,7 @@ {{ __('Name') }} - {{ __('Subject') }} + {{ config('maileclipse.display_as_subject') ? __('Subject') : __('Namespace')}} {{ __('Last edited') }} @@ -42,7 +42,7 @@ {{ $mailable['name'] }} - {{ $mailable['subject'] }} + {{ config('maileclipse.display_as_subject') ? $mailable['subject'] ? $mailable['namespace'] }} {{ (\Carbon\Carbon::createFromTimeStamp($mailable['modified']))->diffForHumans() }} diff --git a/src/MailEclipse.php b/src/MailEclipse.php index 695a608..fc92950 100644 --- a/src/MailEclipse.php +++ b/src/MailEclipse.php @@ -514,8 +514,6 @@ protected static function mailablesList() $fqcns[$i]['markdown'] = self::getMarkdownViewName($mailable_data); $fqcns[$i]['name'] = $name; $fqcns[$i]['namespace'] = $mailableClass; - /** @see \Illuminate\Mail\Mailable@buildSubject for the Str Functions, used to keep consistent. */ - $fqcns[$i]['subject'] = $mailable_data->subject ?? Str::title(Str::snake(class_basename($mailableClass), ' ')); $fqcns[$i]['filename'] = $phpFile->getFilename(); $fqcns[$i]['modified'] = $phpFile->getCTime(); $fqcns[$i]['viewed'] = $phpFile->getATime(); @@ -527,6 +525,9 @@ protected static function mailablesList() $fqcns[$i]['view_path'] = null; $fqcns[$i]['text_view_path'] = null; + /** @see \Illuminate\Mail\Mailable@buildSubject for the Str Functions, used to keep consistent. */ + $fqcns[$i]['subject'] = $mailable_data->subject ?? Str::title(Str::snake(class_basename($mailableClass), ' ')); + if (! is_null($fqcns[$i]['markdown']) && View::exists($fqcns[$i]['markdown'])) { $fqcns[$i]['view_path'] = View($fqcns[$i]['markdown'])->getPath(); } From 3cd110a471fa9ccf581f909a8a5677ac1d9fc6cd Mon Sep 17 00:00:00 2001 From: ReeceM Date: Fri, 11 Feb 2022 20:24:17 +0200 Subject: [PATCH 6/7] update changelog --- changelog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changelog.md b/changelog.md index 25d74dd..84dad9f 100644 --- a/changelog.md +++ b/changelog.md @@ -270,4 +270,9 @@ New Structure: ## Version 3.5.2 ### Changes + - Adds the subject of the email client to the table instead of the namespace. See #79 + +### Fixes + +- Correct custom Mailable directory usage from config, see PR #190 @Bhagyrajaj From de46b9f9f6ee7fcc2872a4e9be19db61e96f1cc3 Mon Sep 17 00:00:00 2001 From: ReeceM Date: Fri, 11 Feb 2022 20:36:54 +0200 Subject: [PATCH 7/7] update changelog --- changelog.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/changelog.md b/changelog.md index 2a27402..60d02c8 100644 --- a/changelog.md +++ b/changelog.md @@ -271,3 +271,13 @@ New Structure: ### Changed Laravel 9 Support + +## Version 4.0.1 + +## Added +- Improve error messages for event when a factory is not found when the setting is on to use them + +## Version 4.0.2 + +## Added +- Allow the subject to be displayed in the mailables table instead of Namespace values