Skip to content

Commit

Permalink
Added custom caster support (#133)
Browse files Browse the repository at this point in the history
* Added custom caster support

* Optimized config

* Update tinker.php

* Update tinker.php

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
huangdijia and taylorotwell authored Sep 24, 2021
1 parent 5711c72 commit e0787e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Console/TinkerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ protected function getCasters()
$casters['Illuminate\Foundation\Application'] = 'Laravel\Tinker\TinkerCaster::castApplication';
}

return $casters;
$config = $this->getLaravel()->make('config');

return array_merge($casters, (array) $config->get('tinker.casters', []));
}

/**
Expand Down

0 comments on commit e0787e8

Please sign in to comment.