-
Notifications
You must be signed in to change notification settings - Fork 25
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 #21 from kirschbaum-development/feature/model-events
Feature - Send Mail via Model Events
- Loading branch information
Showing
43 changed files
with
1,363 additions
and
89 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -8,3 +8,4 @@ phpunit.xml | |
.phpunit.result.cache | ||
.DS_Store | ||
Thumbs.db | ||
.php_cs.cache |
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,125 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->exclude('bootstrap/cache') | ||
->exclude('storage') | ||
->exclude('vendor') | ||
->exclude('bower_components') | ||
->exclude('node_modules') | ||
->in(__DIR__) | ||
->name('*.php') | ||
->notName('*.blade.php') | ||
->ignoreDotFiles(true) | ||
->ignoreVCS(true); | ||
|
||
return PhpCsFixer\Config::create() | ||
->setFinder($finder) | ||
->setRules([ | ||
'@PSR2' => true, | ||
'phpdoc_no_empty_return' => false, | ||
'phpdoc_var_annotation_correct_order' => true, | ||
'array_syntax' => [ | ||
'syntax' => 'short', | ||
], | ||
'no_singleline_whitespace_before_semicolons' => true, | ||
'no_extra_blank_lines' => [ | ||
'break', 'case', 'continue', 'curly_brace_block', 'default', | ||
'extra', 'parenthesis_brace_block', 'return', | ||
'square_brace_block', 'switch', 'throw', 'use', 'useTrait', 'use_trait', | ||
], | ||
'cast_spaces' => [ | ||
'space' => 'single', | ||
], | ||
'concat_space' => [ | ||
'spacing' => 'one', | ||
], | ||
'ordered_imports' => [ | ||
'sort_algorithm' => 'length', | ||
], | ||
'single_quote' => true, | ||
'lowercase_cast' => true, | ||
'lowercase_static_reference' => true, | ||
'no_empty_phpdoc' => true, | ||
'no_empty_comment' => true, | ||
'array_indentation' => true, | ||
// TODO: This isn't working, causes fixer to error. | ||
// 'increment_style' => ['style' => 'post'], | ||
'short_scalar_cast' => true, | ||
'class_attributes_separation' => [ | ||
'elements' => ['const', 'method', 'property'], | ||
], | ||
'no_mixed_echo_print' => [ | ||
'use' => 'echo', | ||
], | ||
'no_unused_imports' => true, | ||
'binary_operator_spaces' => [ | ||
'default' => 'single_space', | ||
], | ||
'no_empty_statement' => true, | ||
'unary_operator_spaces' => true, // $number ++ becomes $number++ | ||
'hash_to_slash_comment' => true, // # becomes // | ||
'standardize_not_equals' => true, // <> becomes != | ||
'native_function_casing' => true, | ||
'ternary_operator_spaces' => true, | ||
'ternary_to_null_coalescing' => true, | ||
'declare_equal_normalize' => [ | ||
'space' => 'single', | ||
], | ||
'function_typehint_space' => true, | ||
'no_leading_import_slash' => true, | ||
'blank_line_before_statement' => [ | ||
'statements' => [ | ||
'break', 'case', 'continue', | ||
'declare', 'default', 'die', | ||
'do', 'exit', 'for', 'foreach', | ||
'goto', 'if', 'include', | ||
'include_once', 'require', 'require_once', | ||
'return', 'switch', 'throw', 'try', 'while', 'yield', | ||
], | ||
], | ||
'combine_consecutive_unsets' => true, | ||
'method_chaining_indentation' => true, | ||
'no_whitespace_in_blank_line' => true, | ||
'blank_line_after_opening_tag' => true, | ||
'no_trailing_comma_in_list_call' => true, | ||
'list_syntax' => ['syntax' => 'short'], | ||
// public function getTimezoneAttribute( ? Banana $value) becomes public function getTimezoneAttribute(?Banana $value) | ||
'compact_nullable_typehint' => true, | ||
'explicit_string_variable' => true, | ||
'no_leading_namespace_whitespace' => true, | ||
'trailing_comma_in_multiline_array' => true, | ||
'not_operator_with_successor_space' => true, | ||
'object_operator_without_whitespace' => true, | ||
'single_blank_line_before_namespace' => true, | ||
'no_blank_lines_after_class_opening' => true, | ||
'no_blank_lines_after_phpdoc' => true, | ||
'no_whitespace_before_comma_in_array' => true, | ||
'no_trailing_comma_in_singleline_array' => true, | ||
'multiline_whitespace_before_semicolons' => [ | ||
'strategy' => 'no_multi_line', | ||
], | ||
'no_multiline_whitespace_around_double_arrow' => true, | ||
'no_useless_return' => true, | ||
'phpdoc_add_missing_param_annotation' => true, | ||
'phpdoc_order' => true, | ||
'phpdoc_scalar' => true, | ||
'phpdoc_separation' => true, | ||
'phpdoc_single_line_var_spacing' => true, | ||
'single_trait_insert_per_statement' => true, | ||
'ordered_class_elements' => [ | ||
'order' => [ | ||
'use_trait', | ||
'constant', | ||
'property', | ||
'construct', | ||
'public', | ||
'protected', | ||
'private', | ||
], | ||
'sortAlgorithm' => 'none', | ||
], | ||
'return_type_declaration' => [ | ||
'space_before' => 'none', | ||
], | ||
]) | ||
->setLineEnding("\n"); |
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
{ | ||
"/js/field.js": "/js/field.js", | ||
"/css/field.css": "/css/field.css" | ||
"/js/fields.js": "/js/fields.js", | ||
"/css/fields.css": "/css/fields.css" | ||
} |
37 changes: 37 additions & 0 deletions
37
migrations/2019_08_28_150259_create_nova_mail_events_table.php
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,37 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateNovaMailEventsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('nova_mail_events', function (Blueprint $table) { | ||
$table->bigIncrements('id'); | ||
$table->unsignedBigInteger('mail_template_id'); | ||
$table->string('model'); | ||
$table->string('name'); | ||
$table->string('column')->nullable(); | ||
$table->string('value')->nullable(); | ||
$table->unsignedBigInteger('user_id'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('nova_mail_events'); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
migrations/2020_09_16_025052_add_mail_event_id_column_to_sent_mails_table.php
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,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AddMailEventIdColumnToSentMailsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('nova_sent_mails', function (Blueprint $table) { | ||
$table->unsignedBigInteger('mail_event_id')->nullable(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('nova_sent_mails', function (Blueprint $table) { | ||
$table->dropColumn('mail_event_id'); | ||
}); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
migrations/2020_09_16_081742_alter_clolumn_sender_id_on_sent_mails.php
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,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AlterClolumnSenderIdOnSentMails extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('nova_sent_mails', function (Blueprint $table) { | ||
$table->unsignedBigInteger('sender_id')->nullable()->change(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('nova_sent_mails', function (Blueprint $table) { | ||
$table->unsignedBigInteger('sender_id')->change(); | ||
}); | ||
} | ||
} |
Oops, something went wrong.