29 lines
746 B
PHP
29 lines
746 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\EtsyAppCredential;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class EtsyAppCredentialSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$keystring = config('services.etsy.keystring');
|
|
$sharedSecret = config('services.etsy.shared_secret');
|
|
|
|
if (filled($keystring) && filled($sharedSecret)) {
|
|
if (EtsyAppCredential::find(1) === null) {
|
|
$credentials = new EtsyAppCredential;
|
|
$credentials->id = 1;
|
|
$credentials->keystring = $keystring;
|
|
$credentials->shared_secret = $sharedSecret;
|
|
$credentials->save();
|
|
}
|
|
}
|
|
}
|
|
}
|