Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal server error #10

Open
PeshrawSarwar opened this issue Sep 6, 2020 · 3 comments
Open

Internal server error #10

PeshrawSarwar opened this issue Sep 6, 2020 · 3 comments

Comments

@PeshrawSarwar
Copy link

PeshrawSarwar commented Sep 6, 2020

POST http://127.0.0.1:8000/follow/2 500 (Internal Server Error)

i have this error when i try to

`methods: {
followUser() {
axios
.post("/follow/" + this.userId)
.then((response) => {
this.status = !this.status;

                console.log(response.data);
            })
            .catch((errors) => {
                if (errors.response.status == 401) {
                    window.location = "/login";
                }
            });
    },
},`

i think i have a problem with axios

@topherlytics
Copy link

I am having the same issue. Did you ever find a resolution to this?

@PeshrawSarwar
Copy link
Author

 <follow-button user-id="{{ $user->id }}" follows="{{ $follows }}" v-show="{{ $user->id !== $profile->id }}"></follow-button>

methods: {
followUser() {
axios
.post("/follow/" + this.userId)
.then(response => {
this.status = !this.status;
console.log(response.data);
})
.catch(errors => {
if (errors.response.status == 401) {
window.location = "/login";
}
});
}
},

@akressevich
Copy link

Doing the following fixed the issue for me:

Make sure to include this in the top of your FollowsController.php.

use App\Models\User;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants