public function store(Request $request)
    {
        $user = $request->user();

        if (Spark::$validateNewTeamsWith) {
            $this->callCustomValidator(
                Spark::$validateNewTeamsWith, $request
            );
        } else {
            $this->validate($request, [
                'name' => 'required|max:255',
            ]);
        }

        $team = $this->teams->create(
            $user, ['name' => $request->name]
        );

        return $this->teams->getAllTeamsForUser($user);
    }
public function store(Request $request)
    {
        $user = $request->user();

        if (Spark::$validateNewTeamsWith) {
            $this->callCustomValidator(
                Spark::$validateNewTeamsWith, $request
            );
        } else {
            $this->validate($request, [
                'name' => 'required|max:255',
            ]);
        }

        $team = $this->teams->create(
            $user, ['name' => $request->name]
        );

        return $this->teams->getAllTeamsForUser($user);
    }
public function store ( Request $ request ) { $ user = $ request -> user ( ) ; if ( Spark :: $ validateNewTeamsWith ) { $ this -> callCustomValidator ( Spark :: $ validateNewTeamsWith , $ request ) ; } else { $ this -> validate ( $ request , [ 'name' => 'required|max:255' , ] ) ; } $ team = $ this -> teams -> create ( $ user , [ 'name' => $ request -> name ] ) ; return $ this -> teams -> getAllTeamsForUser ( $ user ) ; }
Create a new team.

@return \Illuminate\Http\Response
Create a new team .