diff --git a/resources/js/Pages/Auth/Login.vue b/resources/js/Pages/Auth/Login.vue index 726df07..aa7ee4f 100644 --- a/resources/js/Pages/Auth/Login.vue +++ b/resources/js/Pages/Auth/Login.vue @@ -54,7 +54,7 @@ export default { methods: { submit() { this.sending = true - Inertia.post(this.route('login.attempt').url(), { + Inertia.post(this.route('login.attempt'), { email: this.form.email, password: this.form.password, remember: this.form.remember, diff --git a/resources/js/Pages/Contacts/Create.vue b/resources/js/Pages/Contacts/Create.vue index 341f50a..6ca1b17 100644 --- a/resources/js/Pages/Contacts/Create.vue +++ b/resources/js/Pages/Contacts/Create.vue @@ -71,7 +71,7 @@ export default { methods: { submit() { this.form.post({ - url: this.route('contacts.store').url(), + url: this.route('contacts.store'), then: data => Inertia.visit(this.route('contacts.edit', data.id)), }) }, diff --git a/resources/js/Pages/Contacts/Edit.vue b/resources/js/Pages/Contacts/Edit.vue index c7d462a..f27d3b7 100644 --- a/resources/js/Pages/Contacts/Edit.vue +++ b/resources/js/Pages/Contacts/Edit.vue @@ -79,23 +79,23 @@ export default { methods: { submit() { this.form.put({ - url: this.route('contacts.update', this.contact.id).url(), + url: this.route('contacts.update', this.contact.id), then: () => Inertia.visit(this.route('contacts')), }) }, destroy() { if (confirm('Are you sure you want to delete this contact?')) { this.form.delete({ - url: this.route('contacts.destroy', this.contact.id).url(), - then: () => Inertia.replace(this.route('contacts.edit', this.contact.id).url()), + url: this.route('contacts.destroy', this.contact.id), + then: () => Inertia.replace(this.route('contacts.edit', this.contact.id)), }) } }, restore() { if (confirm('Are you sure you want to restore this contact?')) { this.form.put({ - url: this.route('contacts.restore', this.contact.id).url(), - then: () => Inertia.replace(this.route('contacts.edit', this.contact.id).url()), + url: this.route('contacts.restore', this.contact.id), + then: () => Inertia.replace(this.route('contacts.edit', this.contact.id)), }) } }, diff --git a/resources/js/Pages/Contacts/Index.vue b/resources/js/Pages/Contacts/Index.vue index 94f135c..b5d7ef3 100644 --- a/resources/js/Pages/Contacts/Index.vue +++ b/resources/js/Pages/Contacts/Index.vue @@ -94,7 +94,7 @@ export default { form: { handler: _.throttle(function() { let query = _.pickBy(this.form) - Inertia.replace(this.route('contacts', Object.keys(query).length ? query : { remember: 'forget' }).url()) + Inertia.replace(this.route('contacts', Object.keys(query).length ? query : { remember: 'forget' })) }, 150), deep: true, }, diff --git a/resources/js/Pages/Organizations/Create.vue b/resources/js/Pages/Organizations/Create.vue index f986716..0ed043a 100644 --- a/resources/js/Pages/Organizations/Create.vue +++ b/resources/js/Pages/Organizations/Create.vue @@ -77,7 +77,7 @@ export default { methods: { submit() { this.sending = true - Inertia.post(this.route('organizations.store').url(), this.form).then(() => this.sending = false) + Inertia.post(this.route('organizations.store'), this.form).then(() => this.sending = false) }, }, } diff --git a/resources/js/Pages/Organizations/Edit.vue b/resources/js/Pages/Organizations/Edit.vue index 9b7b4aa..e0e0a31 100644 --- a/resources/js/Pages/Organizations/Edit.vue +++ b/resources/js/Pages/Organizations/Edit.vue @@ -111,16 +111,16 @@ export default { }, methods: { submit() { - Inertia.put(this.route('organizations.update', this.organization.id).url(), this.form) + Inertia.put(this.route('organizations.update', this.organization.id), this.form) }, destroy() { if (confirm('Are you sure you want to delete this organization?')) { - Inertia.delete(this.route('organizations.destroy', this.organization.id).url()) + Inertia.delete(this.route('organizations.destroy', this.organization.id)) } }, restore() { if (confirm('Are you sure you want to restore this organization?')) { - Inertia.put(this.route('organizations.restore', this.organization.id).url()) + Inertia.put(this.route('organizations.restore', this.organization.id)) } }, }, diff --git a/resources/js/Pages/Organizations/Index.vue b/resources/js/Pages/Organizations/Index.vue index d39b266..d45b8d5 100644 --- a/resources/js/Pages/Organizations/Index.vue +++ b/resources/js/Pages/Organizations/Index.vue @@ -86,7 +86,7 @@ export default { form: { handler: _.throttle(function() { let query = _.pickBy(this.form) - Inertia.replace(this.route('organizations', Object.keys(query).length ? query : { remember: 'forget' }).url()) + Inertia.replace(this.route('organizations', Object.keys(query).length ? query : { remember: 'forget' })) }, 150), deep: true, }, diff --git a/resources/js/Pages/Users/Create.vue b/resources/js/Pages/Users/Create.vue index 3f0eb07..e30fec7 100644 --- a/resources/js/Pages/Users/Create.vue +++ b/resources/js/Pages/Users/Create.vue @@ -57,7 +57,7 @@ export default { methods: { submit() { this.form.post({ - url: this.route('users.store').url(), + url: this.route('users.store'), then: data => Inertia.visit(this.route('users.edit', data.id)), }) }, diff --git a/resources/js/Pages/Users/Edit.vue b/resources/js/Pages/Users/Edit.vue index 842aaa3..beb8552 100644 --- a/resources/js/Pages/Users/Edit.vue +++ b/resources/js/Pages/Users/Edit.vue @@ -65,23 +65,23 @@ export default { methods: { submit() { this.form.put({ - url: this.route('users.update', this.user.id).url(), + url: this.route('users.update', this.user.id), then: () => Inertia.visit(this.route('users')), }) }, destroy() { if (confirm('Are you sure you want to delete this user?')) { this.form.delete({ - url: this.route('users.destroy', this.user.id).url(), - then: () => Inertia.replace(this.route('users.edit', this.user.id).url()), + url: this.route('users.destroy', this.user.id), + then: () => Inertia.replace(this.route('users.edit', this.user.id)), }) } }, restore() { if (confirm('Are you sure you want to restore this user?')) { this.form.put({ - url: this.route('users.restore', this.user.id).url(), - then: () => Inertia.replace(this.route('users.edit', this.user.id).url()), + url: this.route('users.restore', this.user.id), + then: () => Inertia.replace(this.route('users.edit', this.user.id)), }) } }, diff --git a/resources/js/Pages/Users/Index.vue b/resources/js/Pages/Users/Index.vue index 5d1a048..29b0d42 100644 --- a/resources/js/Pages/Users/Index.vue +++ b/resources/js/Pages/Users/Index.vue @@ -90,7 +90,7 @@ export default { form: { handler: _.throttle(function() { let query = _.pickBy(this.form) - Inertia.replace(this.route('users', Object.keys(query).length ? query : { remember: 'forget' }).url()) + Inertia.replace(this.route('users', Object.keys(query).length ? query : { remember: 'forget' })) }, 150), deep: true, }, diff --git a/resources/js/app.js b/resources/js/app.js index 55fcb4c..736ab50 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -3,7 +3,7 @@ import PortalVue from 'portal-vue' import Vue from 'vue' Vue.config.productionTip = false -Vue.mixin({ methods: { route: window.route } }) +Vue.mixin({ methods: { route: (...args) => window.route(...args).url() } }) Vue.use(PortalVue) let app = document.getElementById('app')