/** * handle * * @param \Codex\Core\Project $project */ public function handle(Project $project) { $that = $this; // Add a method on the project class that creates a new GitSync for that specific project Project::macro('gitSyncer', function () { /** @var Project $this */ return app('codex.hooks.git')->gitSyncer($this); }); }