Ip.php 579 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Dcat\Admin\Form\Field;
  3. class Ip extends Text
  4. {
  5. protected $rules = ['nullable', 'ip'];
  6. /**
  7. * @see https://github.com/RobinHerbots/Inputmask#options
  8. *
  9. * @var array
  10. */
  11. protected $options = [
  12. 'alias' => 'ip',
  13. ];
  14. public function render()
  15. {
  16. $this->inputmask($this->options);
  17. $this->defaultAttribute('style', 'width: 160px;flex:none');
  18. $this->prepend('<i class="fa fa-laptop fa-fw"></i>')
  19. ->defaultAttribute('style', 'width: 200px');
  20. return parent::render();
  21. }
  22. }