I follow custom headers tool in Grid Tools from documentation Normal Action but this always return error whenever i make to submit form from the Action class
class ChangeStatusPage extends Action
{
public $name = 'Ubah Status Massal';
protected $selector = '.change-status-page';
public function handle(Request $request)
{
return $this->response()->success('Import complete!')->refresh(); // even if I just return this when the actino class have form method will always return an error
}
public function form()
{
$this->select('status', __('Status'))
->options(['Belum-dikembalikan' => 'Belum dikembalikan', 'Sudah-dikembalikan' => 'Sudah dikembalikan', 'Hilang/rusak' => 'Hilang/rusak'])
->default('Belum-dikembalikan');
}
public function html()
{
return <<<HTML
<a class='change-status-page btn btn-sm btn-warning me-1'><i class='icon-info-circle'></i>Ubah Status Massal</a>
HTML;
}
}
Here is the example of error:
here is error from log
local.ERROR: OpenAdmin\Admin\Form::model(): Return value must be of type Illuminate\Database\Eloquent\Model, OpenAdmin\Admin\Actions\Interactor\Form returned {"userId":1,"exception":"[object] (TypeError(code: 0): OpenAdmin\\Admin\\Form::model(): Return value must be of type Illuminate\\Database\\Eloquent\\Model, OpenAdmin\\Admin\\Actions\\Interactor\\Form returned at F:\\freelance\\retur-revised\\vendor\\open-admin-org\\open-admin\\src\\Form.php:188)
I follow custom headers tool in Grid Tools from documentation Normal Action but this always return error whenever i make to submit form from the Action class
Here is the example of error:
here is error from log