app/Http/Controllers/GroupUserController.php
/**
     * Accept invite
     *
     * @param GroupUser $groupUser
     * @return mixed
     */
Accept invite
@param GroupUser $groupUser
@return mixed
Accept invite @param GroupUser $groupUser @return mixed
public function accept(GroupUser $groupUser)
    {
        $this->authorize($groupUser);
        if ($groupUser->status === 'accept') {
            return redirect()->back()->withErrors(trans('groups.already-joined'));
        }
        $groupUser->update(['status' => 'accept']);
        $groupUser->group->notifyAdmins($groupUser);
        return redirect()->back()->with('success', trans('groups.you-accepted'));
    }
public function accept ( GroupUser $ groupUser ) { $ this -> authorize ( $ groupUser ) ; if ( $ groupUser -> status === 'accept' ) { return redirect ( ) -> back ( ) -> withErrors ( trans ( 'groups.already-joined' ) ) ; } $ groupUser -> update ( [ 'status' => 'accept' ] ) ; $ groupUser -> group -> notifyAdmins ( $ groupUser ) ; return redirect ( ) -> back ( ) -> with ( 'success' , trans ( 'groups.you-accepted' ) ) ; }
Accept invite
 @param GroupUser $groupUser
 @return mixed
Accept invite @param GroupUser $groupUser @return mixed