Laravel 10 and Vuejs 3 – Simple Invoice Application
In this tutorial, we will create a simple invoice application using Laravel 10 and Vuejs 3. We will start by creating a form to insert invoice data and then insert that data into the database.
Create Invoice
First, we will create a form to input the invoice details. We will use Vuejs 3 to bind the form fields to the data model and handle form submission.
“`html
“`
Insert Invoice in Database
Next, we will handle form submission and send the invoice data to the Laravel backend for insertion into the database.
“`php
// Laravel 10 Controller Method
public function create()
{
$invoice = new Invoice();
$invoice->invoiceNumber = request(‘invoiceNumber’);
$invoice->customerName = request(‘customerName’);
$invoice->amount = request(‘amount’);
$invoice->save();
return response()->json([‘message’ => ‘Invoice created successfully’]);
}
“`
With these steps, we have created a simple invoice application using Laravel 10 and Vuejs 3. We can now input invoice details through the form and insert them into the database using the Laravel backend.
Very nice series! Keep on going!
🙂
Hi! i having a problem in 'customer_id' is passing the name instead of the id can you help me?
You don't need to use two functions and variables to open and close the modal, you can simply just toggle the showModal variable value directly while clicking the closing button.
@click="showModal = false",
just like this.
can someone here give us the source of the new.vue file?, thank you
At the ninth minute, a problem with squiggles of red lines containing the Thai text appeared
Property 'customer_id' does not exist on type '{ $: ComponentInternalInstance; $data: {}; $props: Partial<{}> & Omit<Readonly<ExtractPropTypes<{}>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>; … 10 more …; $watch(source: string | Function, cb: Function, options?: WatchOptions<…> | undefined): WatchStopHandle; } & Readonly<…> & Sha…'.ts(2339)
It's a really good video and very helpful for me but now i'm struggling in video no 7. i don't get how the new FormData() is appear at onsave function. can u explain me please? thank you so much!
hmm
part 5 completed now moving part 6
Please keep going for us
welcome back , please keep going
First viewer and commenter from Bangladesh