<?php

namespace DefStudio\GameEngine\Actions\Teams;

use DefStudio\Actions\Action;
use Illuminate\Support\Facades\Gate;
use DefStudio\GameEngine\Models\Team;

/**
 * @method static Team run(Team $team)
 */
class SaveTeam extends Action
{
    public function handle(Team $team): Team
    {
        Gate::authorize('save', $team);

        $team->save();

        return $team;
    }
}
