Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
RioRizkyRainey authored and StyleCIBot committed Aug 27, 2018
1 parent 32ebd00 commit b973110
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 b973110

Please sign in to comment.