1
0
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:
Hillel Coren 2016-08-04 20:00:50 +03:00
parent d64f18ef99
commit 845e25df2d
2 changed files with 22 additions and 56 deletions

View File

@ -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);
}
}

View File

@ -1,5 +1,6 @@
<?php <?php
use App\Models\PaymentStatus;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
@ -20,7 +21,26 @@ class PaymentsChanges extends Migration
$table->string('name'); $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'); Schema::dropIfExists('payment_methods');
@ -92,7 +112,7 @@ class PaymentsChanges extends Migration
$table->foreign('default_payment_method_id')->references('id')->on('payment_methods'); $table->foreign('default_payment_method_id')->references('id')->on('payment_methods');
}); });
} }
/** /**