How to make my method execute a Closure

Hello,
I'm writing a custom function inside my action which should accept a Closure.

public function autofill(array|Closure $data): void
  {
      $this->url(AssignmentResource::getUrl('create', $data));
  }


Right now this gives the error, Object of class Closure could not be converted to string. Looking at other methods I couldn't find a difference, how do you do this?
Was this page helpful?