diff --git a/CHANGELOG.md b/CHANGELOG.md index 6226162..0fa7eea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes +## [4.4.0](#) +- Added `Stepanenko3\NovaCommandRunner\Traits\RunsArtisan` +- Update `run_by` assignment to use the `getArtisanRunByName` method + ## [4.1.0](#) - `Stepanenko3\NovaCommandRunner\CommandRunner` migrate to `Stepanenko3\NovaCommandRunner\CommandRunnerTool` diff --git a/src/Dto/RunDto.php b/src/Dto/RunDto.php index 75ab56a..3ebabe4 100644 --- a/src/Dto/RunDto.php +++ b/src/Dto/RunDto.php @@ -24,7 +24,11 @@ class RunDto public function __construct() { - $this->run_by = auth()->check() ? auth()->user()->name : ''; + if (auth()->check() && method_exists(auth()->user(), 'getArtisanRunByName')) { + $this->run_by = auth()->user()->getArtisanRunByName(); + } else { + $this->run_by = __('unknown'); + } $this->id = uniqid(); } diff --git a/src/Traits/RunsArtisan.php b/src/Traits/RunsArtisan.php new file mode 100644 index 0000000..a9a76b2 --- /dev/null +++ b/src/Traits/RunsArtisan.php @@ -0,0 +1,16 @@ +name; + } +}