add migration script

This commit is contained in:
Hafifie PKB
2023-11-16 14:34:28 +08:00
parent 729aa6bf29
commit 0b58baefe5
3 changed files with 50 additions and 55 deletions
@@ -0,0 +1,49 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
class MigrationOnePercent extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'onepercent:migrate';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migration of One Percent';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$rollback = Artisan::call('migrate:rollback');
$migrate = Artisan::call('migrate');
$seeder = Artisan::call('db:seed',[
'--class' => 'KadarUpahSeeder',
]);
$this->info('The command was successfully generated!');
}
}
-54
View File
@@ -1,54 +0,0 @@
<?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;
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ class Kernel extends ConsoleKernel
*/
protected $commands = [
Commands\DailyGadai::class,
Commands\TestOnePercent::class,
Commands\MigrationOnePercent::class,
];