set default value for invoices

This commit is contained in:
Edmond Teh
2020-08-24 19:31:23 +08:00
parent 9dad68ecf9
commit 84e9d9d614
3 changed files with 41 additions and 11 deletions
-10
View File
@@ -1,10 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class Invoice extends Controller
{
//
}
@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddDefaultValueInvoices extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('invoices', function (Blueprint $table) {
$table->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) {
//
});
}
}
-1
View File
@@ -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');