mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-17 16:42:48 +01:00
Remove seeder from migration to prevent class not found errors
This commit is contained in:
parent
d64f18ef99
commit
845e25df2d
@ -1,54 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class TestOFX
|
||||
*/
|
||||
class TestBot extends Command
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'ninja:test-bot';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Test Bot';
|
||||
|
||||
/**
|
||||
* TestOFX constructor.
|
||||
*
|
||||
* @param BankAccountService $bankAccountService
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function fire()
|
||||
{
|
||||
$this->info(date('Y-m-d').' Running TestBot...');
|
||||
|
||||
$clientId = env('MSBOT_CLIENT_ID');
|
||||
$clientSecret = env('MSBOT_CLIENT_SECRET');
|
||||
|
||||
$data = sprintf('grant_type=client_credentials&client_id=%s&client_secret=%s&scope=https://graph.microsoft.com/.default', $clientId, $clientSecret);
|
||||
$curl = curl_init();
|
||||
|
||||
$opts = [
|
||||
CURLOPT_URL => MSBOT_LOGIN_URL,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POST => 'POST',
|
||||
CURLOPT_POSTFIELDS => $data,
|
||||
];
|
||||
|
||||
curl_setopt_array($curl, $opts);
|
||||
$response = print_r(curl_exec($response));
|
||||
curl_close($curl);
|
||||
|
||||
print_r($response);
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Models\PaymentStatus;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
@ -20,7 +21,26 @@ class PaymentsChanges extends Migration
|
||||
$table->string('name');
|
||||
});
|
||||
|
||||
(new \PaymentStatusSeeder())->run();
|
||||
$statuses = [
|
||||
['id' => '1', 'name' => 'Pending'],
|
||||
['id' => '2', 'name' => 'Voided'],
|
||||
['id' => '3', 'name' => 'Failed'],
|
||||
['id' => '4', 'name' => 'Completed'],
|
||||
['id' => '5', 'name' => 'Partially Refunded'],
|
||||
['id' => '6', 'name' => 'Refunded'],
|
||||
];
|
||||
|
||||
Eloquent::unguard();
|
||||
foreach ($statuses as $status) {
|
||||
$record = PaymentStatus::find($status['id']);
|
||||
if ($record) {
|
||||
$record->name = $status['name'];
|
||||
$record->save();
|
||||
} else {
|
||||
PaymentStatus::create($status);
|
||||
}
|
||||
}
|
||||
Eloquent::reguard();
|
||||
|
||||
Schema::dropIfExists('payment_methods');
|
||||
|
||||
@ -92,7 +112,7 @@ class PaymentsChanges extends Migration
|
||||
$table->foreign('default_payment_method_id')->references('id')->on('payment_methods');
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user