phplaravelinertiajslaravel-jetstream

How do I customise controller actions in Laravel Jetstream?


I would like to add some data for the Create vue file for the teams feature in Laravel Jetstream, but I haven't seen a way how to publish the vendor controllers. Essentially what I am trying to do is, add the ability on the team creation page to specify a different owner to the team you are currently creating, rather than it just defaulting to the current user.


Solution

  • Jetstream implements a pattern that uses Actions, instead of publishing routes and controllers.

    You can customize the Action that creates a Team in your app/Actions/Jetstream/CreateTeam.php file.

    The Action files should be published with the installation of Jetstream.