From 84e9d9d61453b4383a53bc73b251e37108a7df70 Mon Sep 17 00:00:00 2001 From: Edmond Teh Date: Mon, 24 Aug 2020 19:31:23 +0800 Subject: [PATCH] set default value for invoices --- app/Http/Controllers/Invoice.php | 10 ----- ...8_24_191227_add_default_value_invoices.php | 41 +++++++++++++++++++ routes/api.php | 1 - 3 files changed, 41 insertions(+), 11 deletions(-) delete mode 100644 app/Http/Controllers/Invoice.php create mode 100644 database/migrations/2020_08_24_191227_add_default_value_invoices.php diff --git a/app/Http/Controllers/Invoice.php b/app/Http/Controllers/Invoice.php deleted file mode 100644 index 907c39d9..00000000 --- a/app/Http/Controllers/Invoice.php +++ /dev/null @@ -1,10 +0,0 @@ -string('buyer_company', 50)->default('')->change(); + $table->string('reg_no', 100)->default('')->change(); + $table->string('address', 120)->default('')->change(); + $table->string('contact_no', 20)->default('')->change(); + $table->string('po_number', 20)->default('')->change(); + $table->string('order_no', 20)->default('')->change(); + $table->float('tax_rate')->default(0)->change(); + $table->float('billing_charge_rate')->default(0)->change(); + $table->string('invoice_path')->default('')->change(); + $table->float('amount')->default(0)->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('invoices', function (Blueprint $table) { + // + }); + } +} diff --git a/routes/api.php b/routes/api.php index 0ad9d49f..ebad7dfe 100644 --- a/routes/api.php +++ b/routes/api.php @@ -132,7 +132,6 @@ Route::group(['middleware' => ['role:admin']], function() { // New routes for invoice Route::get('invoice/{id}', 'InvoiceController@show'); - Route::post('invoice/{id}', 'InvoiceController@create'); Route::put('invoice/{id}', 'InvoiceController@edit'); Route::patch('invoice/{id}/status', 'InvoiceController@updateStatus');