ModelExpansionManager.php 438 B

123456789101112131415161718192021222324
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: shenyang
  5. * Date: 2018/6/4
  6. * Time: 下午4:44
  7. */
  8. namespace app\common\managers;
  9. use Illuminate\Support\Collection;
  10. class ModelExpansionManager extends Collection
  11. {
  12. public function get($key, $default = null)
  13. {
  14. if(!$this->has($key)){
  15. $this->put($key,collect());
  16. }
  17. return parent::get($key, $default); // TODO: Change the autogenerated stub
  18. }
  19. }