Skip to content

Commit

Permalink
Update ShowModelTyperMappingsCommand.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrtonandino committed Nov 30, 2024
1 parent 3b888eb commit d392842
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Commands/ShowModelTyperMappingsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use FumeApp\ModelTyper\Actions\GetMappings;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Config;
use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand(name: 'model:typer-mappings')]
Expand Down Expand Up @@ -38,7 +39,7 @@ class ShowModelTyperMappingsCommand extends Command
public function handle(): int
{
try {
$timestampsAsDate = (bool) $this->option('timestamps-date');
$timestampsAsDate = (bool) $this->option('timestamps-date') ?: Config::get('modeltyper.timestamps-date', false);

$mappings = collect(app(GetMappings::class)(setTimestampsToDate: $timestampsAsDate))
->map(fn (string $mappings, string $key): array => [$key, $mappings])
Expand Down

0 comments on commit d392842

Please sign in to comment.