title: How can I add a callback function to Laravel Nova on storing a new resource?
body: <p>In Nova's ResourceStoreController.php, I can see this code:</p>
  
  <pre><code>$model = DB::transaction(function () use ($request, $resource) {
      [$model, $callbacks] = $resource::fill(
          $request, $resource::newModel()
      );
  
      if ($request-&gt;viaRelationship()) {
          $request-&gt;findParentModelOrFail()
                  -&gt;{$request-&gt;viaRelationship}()
                  -&gt;save($model);
      } else {
          $model-&gt;save();
      }
  
      ActionEvent::forResourceCreate($request-&gt;user(), $model)-&gt;save();
  
      collect($callbacks)-&gt;each-&gt;__invoke();
  
      return $model;
  });
  </code></pre>
  
  <p>Which certainly looks like I should be able to set a callback function to it looking at this line:</p>
  
  <pre><code>collect($callbacks)-&gt;each-&gt;__invoke();
  </code></pre>
  
  <p>But how can I set a callback for a particular resource in Laravel Nova?</p>
  
  <p>Basically, I want to trigger an event or callback when I store a new resource, but only when the resource is created through nova.</p>