Add encrypted Etsy app credential settings
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 23s
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 23s
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user