Skip to content

Commit

Permalink
Merge pull request #2 from RioRizkyRainey/analysis-8n5a4g
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
RioRizkyRainey authored Aug 27, 2018
2 parents 32ebd00 + b973110 commit b9fae0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/LaraCedServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function register()
$this->dropColumn(['created_by', 'updated_by', 'deleted_by']);
});

Blueprint::macro('cedForeign', function() use($userModel) {
Blueprint::macro('cedForeign', function () use ($userModel) {
$tableName = $this->getTable();

$this->foreign('created_by', 'fk_' . $tableName . 'has_created_by')->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION');
Expand All @@ -48,25 +48,25 @@ public function register()
$this->foreign('deleted_by', 'fk_' . $tableName . 'has_deleted_by')->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION');
});

Blueprint::macro('creatorForeign', function ($name = 'created_by') use($userModel) {
Blueprint::macro('creatorForeign', function ($name = 'created_by') use ($userModel) {
$tableName = $this->getTable();

$this->foreign($name, 'fk_' . $tableName . 'has_' . $name)->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION');
});

Blueprint::macro('editorForeign', function ($name = 'updated_by') use($userModel) {
Blueprint::macro('editorForeign', function ($name = 'updated_by') use ($userModel) {
$tableName = $this->getTable();

$this->foreign($name, 'fk_' . $tableName . 'has_' . $name)->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION');
});

Blueprint::macro('destroyerForeign', function ($name = 'deleted_by') use($userModel) {
Blueprint::macro('destroyerForeign', function ($name = 'deleted_by') use ($userModel) {
$tableName = $this->getTable();

$this->foreign($name, 'fk_' . $tableName . 'has_' . $name)->references('id')->on($userModel)->onUpdate('NO ACTION')->onDelete('NO ACTION');
});

Blueprint::macro('dropCedForeign', function () use($userModel) {
Blueprint::macro('dropCedForeign', function () use ($userModel) {
$tableName = $this->getTable();

$this->dropForeign('fk_' . $tableName . '_has_created_by');
Expand Down

0 comments on commit b9fae0e

Please sign in to comment.