How To Display My Invoice Data In Invoice Template
I'm using Laravel 5.7
& VueJs 2.5.*
...
I have invoices table, i need to display specific invoice in a new component, so user can see whatever invoice he wants or print that invoice.
I don't know how to do that, i'm just playing around, if you could help me out, i'll be very grateful to you.
<router-link>
to the component
<router-link to="/ct-invoice-view" @click="openInvoice(ctInvoice)">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Displaying Customer
information here like this:
<div class="col-sm-4 invoice-col">
<address v-for="ctInvoice in ctInvoices" :key="ctInvoice.id">
<strong>Customer Info</strong><br>
Name: <span>{{ ctInvoice.customer.customer_name }}</span>
Invoice view component data()
& method{}
data() {
return {
ctInvoices: {},
customers: null
};
},
methods: {
openInvoice(ctInvoice) {
axios
.get("api/ct-invoice/show/" + this.viewInvoice)
.then(({
data
}) => (this.ctInvoices = data.data));
},
Image for Better Understanding
javascript html laravel vue.js vuejs2
add a comment |
I'm using Laravel 5.7
& VueJs 2.5.*
...
I have invoices table, i need to display specific invoice in a new component, so user can see whatever invoice he wants or print that invoice.
I don't know how to do that, i'm just playing around, if you could help me out, i'll be very grateful to you.
<router-link>
to the component
<router-link to="/ct-invoice-view" @click="openInvoice(ctInvoice)">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Displaying Customer
information here like this:
<div class="col-sm-4 invoice-col">
<address v-for="ctInvoice in ctInvoices" :key="ctInvoice.id">
<strong>Customer Info</strong><br>
Name: <span>{{ ctInvoice.customer.customer_name }}</span>
Invoice view component data()
& method{}
data() {
return {
ctInvoices: {},
customers: null
};
},
methods: {
openInvoice(ctInvoice) {
axios
.get("api/ct-invoice/show/" + this.viewInvoice)
.then(({
data
}) => (this.ctInvoices = data.data));
},
Image for Better Understanding
javascript html laravel vue.js vuejs2
I am unsure of the ask here. Can you create a simple jsFiddle with sample data and post it?
– Sujil Maharjan
Nov 9 '18 at 18:30
i don't know about Fiddie, i just need to view my invoice, like when i click on view button, that specific invoice detail should display.... @SujilMaharjan
– Saif Zakir
Nov 9 '18 at 19:37
add a comment |
I'm using Laravel 5.7
& VueJs 2.5.*
...
I have invoices table, i need to display specific invoice in a new component, so user can see whatever invoice he wants or print that invoice.
I don't know how to do that, i'm just playing around, if you could help me out, i'll be very grateful to you.
<router-link>
to the component
<router-link to="/ct-invoice-view" @click="openInvoice(ctInvoice)">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Displaying Customer
information here like this:
<div class="col-sm-4 invoice-col">
<address v-for="ctInvoice in ctInvoices" :key="ctInvoice.id">
<strong>Customer Info</strong><br>
Name: <span>{{ ctInvoice.customer.customer_name }}</span>
Invoice view component data()
& method{}
data() {
return {
ctInvoices: {},
customers: null
};
},
methods: {
openInvoice(ctInvoice) {
axios
.get("api/ct-invoice/show/" + this.viewInvoice)
.then(({
data
}) => (this.ctInvoices = data.data));
},
Image for Better Understanding
javascript html laravel vue.js vuejs2
I'm using Laravel 5.7
& VueJs 2.5.*
...
I have invoices table, i need to display specific invoice in a new component, so user can see whatever invoice he wants or print that invoice.
I don't know how to do that, i'm just playing around, if you could help me out, i'll be very grateful to you.
<router-link>
to the component
<router-link to="/ct-invoice-view" @click="openInvoice(ctInvoice)">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Displaying Customer
information here like this:
<div class="col-sm-4 invoice-col">
<address v-for="ctInvoice in ctInvoices" :key="ctInvoice.id">
<strong>Customer Info</strong><br>
Name: <span>{{ ctInvoice.customer.customer_name }}</span>
Invoice view component data()
& method{}
data() {
return {
ctInvoices: {},
customers: null
};
},
methods: {
openInvoice(ctInvoice) {
axios
.get("api/ct-invoice/show/" + this.viewInvoice)
.then(({
data
}) => (this.ctInvoices = data.data));
},
Image for Better Understanding
javascript html laravel vue.js vuejs2
javascript html laravel vue.js vuejs2
edited Nov 9 '18 at 19:36
Saif Zakir
asked Nov 9 '18 at 15:57
Saif ZakirSaif Zakir
8410
8410
I am unsure of the ask here. Can you create a simple jsFiddle with sample data and post it?
– Sujil Maharjan
Nov 9 '18 at 18:30
i don't know about Fiddie, i just need to view my invoice, like when i click on view button, that specific invoice detail should display.... @SujilMaharjan
– Saif Zakir
Nov 9 '18 at 19:37
add a comment |
I am unsure of the ask here. Can you create a simple jsFiddle with sample data and post it?
– Sujil Maharjan
Nov 9 '18 at 18:30
i don't know about Fiddie, i just need to view my invoice, like when i click on view button, that specific invoice detail should display.... @SujilMaharjan
– Saif Zakir
Nov 9 '18 at 19:37
I am unsure of the ask here. Can you create a simple jsFiddle with sample data and post it?
– Sujil Maharjan
Nov 9 '18 at 18:30
I am unsure of the ask here. Can you create a simple jsFiddle with sample data and post it?
– Sujil Maharjan
Nov 9 '18 at 18:30
i don't know about Fiddie, i just need to view my invoice, like when i click on view button, that specific invoice detail should display.... @SujilMaharjan
– Saif Zakir
Nov 9 '18 at 19:37
i don't know about Fiddie, i just need to view my invoice, like when i click on view button, that specific invoice detail should display.... @SujilMaharjan
– Saif Zakir
Nov 9 '18 at 19:37
add a comment |
2 Answers
2
active
oldest
votes
You need to look at Dynamic Route matching: https://router.vuejs.org/guide/essentials/dynamic-matching.html#reacting-to-params-changes
Then you need to use axios.get in invoice views beforeMount function where this.$route.params.id will hold the invoice ID you want to load if the link is applied like so:
<router-link :to="`/ct-invoice-view/${ctInvoice.id}`">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Alternatively...
I suggest not navigating away from the list, it can be irritating for users having filtered the list then returning to it to look at more invoices and having to filter again unless the filter options and current results are sticky
There are a number of ways of doing this and they are lengthy to example, Typically I would make proper use of a modal and the invoice view load the data on display but to get you started a basic in page solution to experiment with, then try adapting in a reusable modal component later:
<button @click="showInvoice = ctInvoice.id">
<i class="fas fa-eye fa-lg text-blue"></i>
</button>
data() {
return {
loading: false,
invoice: {},
customers: null
};
},
computed: {
showInvoice: {
get: function() {
return this.invoice.hasOwnProperty('id');
},
set: function(value) {
if(value === false) {
this.invoice = {};
return;
}
// could check a cache first and push the cached item into this.invoice else load it:
this.loading = true;
axios.get("api/ct-invoice/show/" + value).then(response => {
// you could push the invoice into a cache
this.invoice = response.data;
}).cache(error => {
// handle error
}).finally(() => {
this.loading = false;
});
}
}
}
In view-invoice component have a close button with bind @click="$emit('close')"
Check this article for how $emit works: https://vuejs.org/v2/guide/components-custom-events.html
<div v-if="loading" class="loading-overlay"></div>
<view-invoice v-if="showInvoice" :invoice="invoice" @close="showInvoice = false" />
<table v-else>....</table>
Hide the table when displaying the invoice, experiment with using v-show instead of v-if upon loosing table content state.
Inside your invoice view, property called invoice will contain the invoice data.
Check this article for how to use props: https://vuejs.org/v2/guide/components-props.html
Hint: The @close listens to the $emit('close')
Could also make use of when switching between table and invoice view.
https://vuejs.org/v2/guide/transitions.html
add a comment |
@MarcNewton
I did something like this, it's working for me, can u just review it for me:
<router-link>
to the Invoice View component
<router-link v-bind:to="{name: 'ctInvoiceView', params: {id: ctInvoice.id}}">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Getting Data of Specific Invoice ID Like This:
created: function() {
axios
.get("/api/ct-invoice/" + this.$route.params.id)
.then(({
data
}) => {
console.log(data);
this.form = new Form(data);
})
.catch(error => {
console.log(error.response);
});
},
1
Since you are working with Laravel, You do not need to use From data objects. JSON is native to Laravel. For example in InvoiceController@show($id) you can do: return Invoice::findOrFail($id). In axios .then(response => { console.log(response.data) }).
– Marc Newton
Nov 14 '18 at 13:17
1
When posting axios.post(URI, this.form).... is sufficient, the native raw javascript object will be posted as JSON by default and Laravel will handle that out of the box, Laravels $request->input will have parsed the posted object as if it was a Form object that was posted, this will make your code a little more streamlined. No need to JSON encode or decode anything...
– Marc Newton
Nov 14 '18 at 13:26
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229161%2fhow-to-display-my-invoice-data-in-invoice-template%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to look at Dynamic Route matching: https://router.vuejs.org/guide/essentials/dynamic-matching.html#reacting-to-params-changes
Then you need to use axios.get in invoice views beforeMount function where this.$route.params.id will hold the invoice ID you want to load if the link is applied like so:
<router-link :to="`/ct-invoice-view/${ctInvoice.id}`">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Alternatively...
I suggest not navigating away from the list, it can be irritating for users having filtered the list then returning to it to look at more invoices and having to filter again unless the filter options and current results are sticky
There are a number of ways of doing this and they are lengthy to example, Typically I would make proper use of a modal and the invoice view load the data on display but to get you started a basic in page solution to experiment with, then try adapting in a reusable modal component later:
<button @click="showInvoice = ctInvoice.id">
<i class="fas fa-eye fa-lg text-blue"></i>
</button>
data() {
return {
loading: false,
invoice: {},
customers: null
};
},
computed: {
showInvoice: {
get: function() {
return this.invoice.hasOwnProperty('id');
},
set: function(value) {
if(value === false) {
this.invoice = {};
return;
}
// could check a cache first and push the cached item into this.invoice else load it:
this.loading = true;
axios.get("api/ct-invoice/show/" + value).then(response => {
// you could push the invoice into a cache
this.invoice = response.data;
}).cache(error => {
// handle error
}).finally(() => {
this.loading = false;
});
}
}
}
In view-invoice component have a close button with bind @click="$emit('close')"
Check this article for how $emit works: https://vuejs.org/v2/guide/components-custom-events.html
<div v-if="loading" class="loading-overlay"></div>
<view-invoice v-if="showInvoice" :invoice="invoice" @close="showInvoice = false" />
<table v-else>....</table>
Hide the table when displaying the invoice, experiment with using v-show instead of v-if upon loosing table content state.
Inside your invoice view, property called invoice will contain the invoice data.
Check this article for how to use props: https://vuejs.org/v2/guide/components-props.html
Hint: The @close listens to the $emit('close')
Could also make use of when switching between table and invoice view.
https://vuejs.org/v2/guide/transitions.html
add a comment |
You need to look at Dynamic Route matching: https://router.vuejs.org/guide/essentials/dynamic-matching.html#reacting-to-params-changes
Then you need to use axios.get in invoice views beforeMount function where this.$route.params.id will hold the invoice ID you want to load if the link is applied like so:
<router-link :to="`/ct-invoice-view/${ctInvoice.id}`">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Alternatively...
I suggest not navigating away from the list, it can be irritating for users having filtered the list then returning to it to look at more invoices and having to filter again unless the filter options and current results are sticky
There are a number of ways of doing this and they are lengthy to example, Typically I would make proper use of a modal and the invoice view load the data on display but to get you started a basic in page solution to experiment with, then try adapting in a reusable modal component later:
<button @click="showInvoice = ctInvoice.id">
<i class="fas fa-eye fa-lg text-blue"></i>
</button>
data() {
return {
loading: false,
invoice: {},
customers: null
};
},
computed: {
showInvoice: {
get: function() {
return this.invoice.hasOwnProperty('id');
},
set: function(value) {
if(value === false) {
this.invoice = {};
return;
}
// could check a cache first and push the cached item into this.invoice else load it:
this.loading = true;
axios.get("api/ct-invoice/show/" + value).then(response => {
// you could push the invoice into a cache
this.invoice = response.data;
}).cache(error => {
// handle error
}).finally(() => {
this.loading = false;
});
}
}
}
In view-invoice component have a close button with bind @click="$emit('close')"
Check this article for how $emit works: https://vuejs.org/v2/guide/components-custom-events.html
<div v-if="loading" class="loading-overlay"></div>
<view-invoice v-if="showInvoice" :invoice="invoice" @close="showInvoice = false" />
<table v-else>....</table>
Hide the table when displaying the invoice, experiment with using v-show instead of v-if upon loosing table content state.
Inside your invoice view, property called invoice will contain the invoice data.
Check this article for how to use props: https://vuejs.org/v2/guide/components-props.html
Hint: The @close listens to the $emit('close')
Could also make use of when switching between table and invoice view.
https://vuejs.org/v2/guide/transitions.html
add a comment |
You need to look at Dynamic Route matching: https://router.vuejs.org/guide/essentials/dynamic-matching.html#reacting-to-params-changes
Then you need to use axios.get in invoice views beforeMount function where this.$route.params.id will hold the invoice ID you want to load if the link is applied like so:
<router-link :to="`/ct-invoice-view/${ctInvoice.id}`">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Alternatively...
I suggest not navigating away from the list, it can be irritating for users having filtered the list then returning to it to look at more invoices and having to filter again unless the filter options and current results are sticky
There are a number of ways of doing this and they are lengthy to example, Typically I would make proper use of a modal and the invoice view load the data on display but to get you started a basic in page solution to experiment with, then try adapting in a reusable modal component later:
<button @click="showInvoice = ctInvoice.id">
<i class="fas fa-eye fa-lg text-blue"></i>
</button>
data() {
return {
loading: false,
invoice: {},
customers: null
};
},
computed: {
showInvoice: {
get: function() {
return this.invoice.hasOwnProperty('id');
},
set: function(value) {
if(value === false) {
this.invoice = {};
return;
}
// could check a cache first and push the cached item into this.invoice else load it:
this.loading = true;
axios.get("api/ct-invoice/show/" + value).then(response => {
// you could push the invoice into a cache
this.invoice = response.data;
}).cache(error => {
// handle error
}).finally(() => {
this.loading = false;
});
}
}
}
In view-invoice component have a close button with bind @click="$emit('close')"
Check this article for how $emit works: https://vuejs.org/v2/guide/components-custom-events.html
<div v-if="loading" class="loading-overlay"></div>
<view-invoice v-if="showInvoice" :invoice="invoice" @close="showInvoice = false" />
<table v-else>....</table>
Hide the table when displaying the invoice, experiment with using v-show instead of v-if upon loosing table content state.
Inside your invoice view, property called invoice will contain the invoice data.
Check this article for how to use props: https://vuejs.org/v2/guide/components-props.html
Hint: The @close listens to the $emit('close')
Could also make use of when switching between table and invoice view.
https://vuejs.org/v2/guide/transitions.html
You need to look at Dynamic Route matching: https://router.vuejs.org/guide/essentials/dynamic-matching.html#reacting-to-params-changes
Then you need to use axios.get in invoice views beforeMount function where this.$route.params.id will hold the invoice ID you want to load if the link is applied like so:
<router-link :to="`/ct-invoice-view/${ctInvoice.id}`">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Alternatively...
I suggest not navigating away from the list, it can be irritating for users having filtered the list then returning to it to look at more invoices and having to filter again unless the filter options and current results are sticky
There are a number of ways of doing this and they are lengthy to example, Typically I would make proper use of a modal and the invoice view load the data on display but to get you started a basic in page solution to experiment with, then try adapting in a reusable modal component later:
<button @click="showInvoice = ctInvoice.id">
<i class="fas fa-eye fa-lg text-blue"></i>
</button>
data() {
return {
loading: false,
invoice: {},
customers: null
};
},
computed: {
showInvoice: {
get: function() {
return this.invoice.hasOwnProperty('id');
},
set: function(value) {
if(value === false) {
this.invoice = {};
return;
}
// could check a cache first and push the cached item into this.invoice else load it:
this.loading = true;
axios.get("api/ct-invoice/show/" + value).then(response => {
// you could push the invoice into a cache
this.invoice = response.data;
}).cache(error => {
// handle error
}).finally(() => {
this.loading = false;
});
}
}
}
In view-invoice component have a close button with bind @click="$emit('close')"
Check this article for how $emit works: https://vuejs.org/v2/guide/components-custom-events.html
<div v-if="loading" class="loading-overlay"></div>
<view-invoice v-if="showInvoice" :invoice="invoice" @close="showInvoice = false" />
<table v-else>....</table>
Hide the table when displaying the invoice, experiment with using v-show instead of v-if upon loosing table content state.
Inside your invoice view, property called invoice will contain the invoice data.
Check this article for how to use props: https://vuejs.org/v2/guide/components-props.html
Hint: The @close listens to the $emit('close')
Could also make use of when switching between table and invoice view.
https://vuejs.org/v2/guide/transitions.html
edited Nov 14 '18 at 13:21
answered Nov 10 '18 at 16:01
Marc NewtonMarc Newton
1,9281421
1,9281421
add a comment |
add a comment |
@MarcNewton
I did something like this, it's working for me, can u just review it for me:
<router-link>
to the Invoice View component
<router-link v-bind:to="{name: 'ctInvoiceView', params: {id: ctInvoice.id}}">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Getting Data of Specific Invoice ID Like This:
created: function() {
axios
.get("/api/ct-invoice/" + this.$route.params.id)
.then(({
data
}) => {
console.log(data);
this.form = new Form(data);
})
.catch(error => {
console.log(error.response);
});
},
1
Since you are working with Laravel, You do not need to use From data objects. JSON is native to Laravel. For example in InvoiceController@show($id) you can do: return Invoice::findOrFail($id). In axios .then(response => { console.log(response.data) }).
– Marc Newton
Nov 14 '18 at 13:17
1
When posting axios.post(URI, this.form).... is sufficient, the native raw javascript object will be posted as JSON by default and Laravel will handle that out of the box, Laravels $request->input will have parsed the posted object as if it was a Form object that was posted, this will make your code a little more streamlined. No need to JSON encode or decode anything...
– Marc Newton
Nov 14 '18 at 13:26
add a comment |
@MarcNewton
I did something like this, it's working for me, can u just review it for me:
<router-link>
to the Invoice View component
<router-link v-bind:to="{name: 'ctInvoiceView', params: {id: ctInvoice.id}}">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Getting Data of Specific Invoice ID Like This:
created: function() {
axios
.get("/api/ct-invoice/" + this.$route.params.id)
.then(({
data
}) => {
console.log(data);
this.form = new Form(data);
})
.catch(error => {
console.log(error.response);
});
},
1
Since you are working with Laravel, You do not need to use From data objects. JSON is native to Laravel. For example in InvoiceController@show($id) you can do: return Invoice::findOrFail($id). In axios .then(response => { console.log(response.data) }).
– Marc Newton
Nov 14 '18 at 13:17
1
When posting axios.post(URI, this.form).... is sufficient, the native raw javascript object will be posted as JSON by default and Laravel will handle that out of the box, Laravels $request->input will have parsed the posted object as if it was a Form object that was posted, this will make your code a little more streamlined. No need to JSON encode or decode anything...
– Marc Newton
Nov 14 '18 at 13:26
add a comment |
@MarcNewton
I did something like this, it's working for me, can u just review it for me:
<router-link>
to the Invoice View component
<router-link v-bind:to="{name: 'ctInvoiceView', params: {id: ctInvoice.id}}">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Getting Data of Specific Invoice ID Like This:
created: function() {
axios
.get("/api/ct-invoice/" + this.$route.params.id)
.then(({
data
}) => {
console.log(data);
this.form = new Form(data);
})
.catch(error => {
console.log(error.response);
});
},
@MarcNewton
I did something like this, it's working for me, can u just review it for me:
<router-link>
to the Invoice View component
<router-link v-bind:to="{name: 'ctInvoiceView', params: {id: ctInvoice.id}}">
<i class="fas fa-eye fa-lg text-blue"></i>
</router-link>
Getting Data of Specific Invoice ID Like This:
created: function() {
axios
.get("/api/ct-invoice/" + this.$route.params.id)
.then(({
data
}) => {
console.log(data);
this.form = new Form(data);
})
.catch(error => {
console.log(error.response);
});
},
answered Nov 14 '18 at 12:29
Saif ZakirSaif Zakir
8410
8410
1
Since you are working with Laravel, You do not need to use From data objects. JSON is native to Laravel. For example in InvoiceController@show($id) you can do: return Invoice::findOrFail($id). In axios .then(response => { console.log(response.data) }).
– Marc Newton
Nov 14 '18 at 13:17
1
When posting axios.post(URI, this.form).... is sufficient, the native raw javascript object will be posted as JSON by default and Laravel will handle that out of the box, Laravels $request->input will have parsed the posted object as if it was a Form object that was posted, this will make your code a little more streamlined. No need to JSON encode or decode anything...
– Marc Newton
Nov 14 '18 at 13:26
add a comment |
1
Since you are working with Laravel, You do not need to use From data objects. JSON is native to Laravel. For example in InvoiceController@show($id) you can do: return Invoice::findOrFail($id). In axios .then(response => { console.log(response.data) }).
– Marc Newton
Nov 14 '18 at 13:17
1
When posting axios.post(URI, this.form).... is sufficient, the native raw javascript object will be posted as JSON by default and Laravel will handle that out of the box, Laravels $request->input will have parsed the posted object as if it was a Form object that was posted, this will make your code a little more streamlined. No need to JSON encode or decode anything...
– Marc Newton
Nov 14 '18 at 13:26
1
1
Since you are working with Laravel, You do not need to use From data objects. JSON is native to Laravel. For example in InvoiceController@show($id) you can do: return Invoice::findOrFail($id). In axios .then(response => { console.log(response.data) }).
– Marc Newton
Nov 14 '18 at 13:17
Since you are working with Laravel, You do not need to use From data objects. JSON is native to Laravel. For example in InvoiceController@show($id) you can do: return Invoice::findOrFail($id). In axios .then(response => { console.log(response.data) }).
– Marc Newton
Nov 14 '18 at 13:17
1
1
When posting axios.post(URI, this.form).... is sufficient, the native raw javascript object will be posted as JSON by default and Laravel will handle that out of the box, Laravels $request->input will have parsed the posted object as if it was a Form object that was posted, this will make your code a little more streamlined. No need to JSON encode or decode anything...
– Marc Newton
Nov 14 '18 at 13:26
When posting axios.post(URI, this.form).... is sufficient, the native raw javascript object will be posted as JSON by default and Laravel will handle that out of the box, Laravels $request->input will have parsed the posted object as if it was a Form object that was posted, this will make your code a little more streamlined. No need to JSON encode or decode anything...
– Marc Newton
Nov 14 '18 at 13:26
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229161%2fhow-to-display-my-invoice-data-in-invoice-template%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I am unsure of the ask here. Can you create a simple jsFiddle with sample data and post it?
– Sujil Maharjan
Nov 9 '18 at 18:30
i don't know about Fiddie, i just need to view my invoice, like when i click on view button, that specific invoice detail should display.... @SujilMaharjan
– Saif Zakir
Nov 9 '18 at 19:37