9 months ago

Submitting Post Request From Vue Throwing MethodNotAllowedException

Posted 9 months ago by boldstar

So I changed my set up to use vue for my views and I am attempting to make a login post request which is returning an alarm

exception: "Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException",

Here is my workflow

Vue login component

    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-6">
                <div class="card card-default">
                    <div class="card-header">

                    <div class="card-body">
                    <form @submit.prevent="login">
                        <input type="text" v-model="username" class="form-control mb-3" placeholder="Email">
                        <input type="password" v-model="password" class="form-control mb-3" placeholder="Password">
                            <button type="submit" class="btn btn-primary btn-block">Login</button>

    export default {
        name: 'login',
        data() {
            return {
                username: '',
                password: ''
        methods: {
            login() {
                this.$store.dispatch('login', {                    
                    username: this.username,
                    password: this.password

Here is the store action that I am calling

actions: {
    login(context, credentials) {'/login', {
            username: credentials.username,
            password: credentials.password
        .then(response => {
        .catch(error => {

which I want to then send to my web.php routes however I think this is where I am running into my issue

Route::domain('multitenant-diy.test')->group(function () { 
    Route::get('/{any}', '[email protected]')->where('any', '.*');
    Route::post('/login', 'Auth\[email protected]');

which is supposed to then call the standard login controller that comes with the auth scaffolding...

Can you make a post request from vuex to the web.php file?

Please sign in or create an account to participate in this conversation.