Now, let's try to add one more field to our form and database: due_date with a date picker.
Prepare Database/Controller
I will just show you the code without any comments. These are Laravel fundamentals, I'm sure you know them.
Migration:
php artisan make:migration add_due_date_to_tasks_table
Schema::table('tasks', function (Blueprint $table) { $table->date('due_date')->nullable();});
Then, we run:
php artisan migrate
Adding to...
in Create.vue:
const submitForm = () => { form.transform((data) => ({ ...data, due_date: data.due_date ? data.due_date.toDate(getLocalTimeZone()) : null, ... toDate is red underlined. Property 'toDate' does not exist on type 'never'.ts-plugin(2339)
I am not sure on how to best fix this issue at this time. Will play around with more time at hand as this one might require more changes, sorry.
ps. Warnings like this are annoying, but at this point - it doesn't impact the functionality.
Yes, doesn't impact on funcionality. Typescript sometimes is too strict, maybe