mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-29 09:14:12 +00:00
Add setting malaysia bank table and controller
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\MalaysiaBank;
|
||||
|
||||
class MalaysiaBankController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return MalaysiaBank::all();
|
||||
}
|
||||
|
||||
public function show(MalaysiaBank $malaysiaBank)
|
||||
{
|
||||
return $malaysiaBank;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$malaysiaBank = MalaysiaBank::create($request->all());
|
||||
|
||||
return response()->json($malaysiaBank, 201);
|
||||
}
|
||||
|
||||
public function update(Request $request, MalaysiaBank $malaysiaBank)
|
||||
{
|
||||
$malaysiaBank->update($request->all());
|
||||
|
||||
return response()->json($malaysiaBank, 200);
|
||||
}
|
||||
|
||||
public function delete(MalaysiaBank $malaysiaBank)
|
||||
{
|
||||
$malaysiaBank->delete();
|
||||
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MalaysiaBank extends Model
|
||||
{
|
||||
protected $fillable = ['company_name','bank_name','acc_no','bank_address','swift','cnap','bank_branch'];
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(Model::class, function (Faker $faker) {
|
||||
return [
|
||||
//
|
||||
];
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateSettingMalaysiaBankTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('setting_malaysia_banks', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('company_name');
|
||||
$table->string('bank_name');
|
||||
$table->string('acc_no');
|
||||
$table->string('bank_address');
|
||||
$table->string('swift');
|
||||
$table->string('cnap');
|
||||
$table->string('bank_branch');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('setting_malaysia_banks');
|
||||
}
|
||||
}
|
||||
@@ -20,5 +20,6 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(SettingCreditSeeder::class);
|
||||
$this->call(SuppliersTableSeeder::class);
|
||||
$this->call(MarkingSeeder::class);
|
||||
$this->call(MalaysiaBankSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class MalaysiaBankSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user