ResetPassword.php 1007 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Admin\Actions\Grid;
  3. use App\Admin\Actions\Form\ResetPasswordForm;
  4. use App\Models\Account;
  5. use Dcat\Admin\Actions\Response;
  6. use Dcat\Admin\Form\AbstractTool;
  7. use Dcat\Admin\Grid\RowAction;
  8. use Dcat\Admin\Traits\HasPermissions;
  9. use Dcat\Admin\Widgets\Modal;
  10. use Illuminate\Contracts\Auth\Authenticatable;
  11. use Illuminate\Database\Eloquent\Model;
  12. use Illuminate\Http\Request;
  13. class ResetPassword extends AbstractTool
  14. {
  15. /**
  16. * @return string
  17. */
  18. protected $title = '重置密码';
  19. protected $model;
  20. public function __construct(string $model = null, $id = 0)
  21. {
  22. $this->model = $model;
  23. $this->title = '<i class="feather icon-lock"></i> ' . $this->title;
  24. $this->id = $id;
  25. }
  26. public function render()
  27. {
  28. $form = ResetPasswordForm::make()->payload(['id' => $this->id]);
  29. return Modal::make()
  30. ->lg()
  31. ->title($this->title)
  32. ->body($form)
  33. ->button($this->title);
  34. }
  35. }