create nad update gadai table migration and add services class for one percent

This commit is contained in:
Hafifie PKB
2023-11-08 14:52:20 +08:00
parent 7921910c9a
commit c999d26886
5 changed files with 206 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Services\OnePercentServices;
class TestOnePercent extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'onepercent:test';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Update JBG for every active gadai';
/**
* Create a new command instance.
*
* @return void
*/
protected $onepercentserv;
public function __construct(OnePercentServices $onepercentserv)
{
$this->onepercentserv = $onepercentserv;
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$pemb = $this->ask('Pembiayaan?');
$nm = $this->ask('Nilaimarhun?');
$ku = $this->ask('Kadarujrah?');
$marg = $this->ask('Margin?');
$test = $this->onepercentserv->kiraanKeuntunganSebenar($pemb,$nm,$ku,$marg);
dd($test);
return $test;
}
}
+2
View File
@@ -18,6 +18,8 @@ class Kernel extends ConsoleKernel
*/
protected $commands = [
Commands\DailyGadai::class,
Commands\TestOnePercent::class,
];
/**