Viewing File: /home/ubuntu/route-and-root-backend-base/database/seeders/SettingsSeeder.php
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use DB,Schema;
class SettingsSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('settings')->delete();
DB::table('settings')->insert([
[
'key' => 'site_name',
'value' => 'PoshMarkets',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'frontend_url',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'tag_name',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'site_logo',
'value' => env('APP_URL').'/logo.png',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'site_icon',
'value' => env('APP_URL').'/favicon.png',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'version',
'value' => 'v1.0.0',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'default_lang',
'value' => 'en',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'currency',
'value' => '$',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'currency_code',
'value' => 'USD',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'tax_percentage',
'value' => 10,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'admin_take_count',
'value' => 12,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'is_demo_control_enabled',
'value' => 0,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'is_account_email_verification',
'value' => NO,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'is_email_notification',
'value' => YES,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'is_email_configured',
'value' => NO,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'is_push_notification',
'value' => NO,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'chat_socket_url',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'MAILGUN_PUBLIC_KEY',
'value' => "",
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'MAILGUN_PRIVATE_KEY',
'value' => "",
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'token_expiry_hour',
'value' => 10000000,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'copyright_content',
'value' => "Copyrights ".date('Y').". All rights reserved.",
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'contact_email',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'contact_address',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'contact_mobile',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'google_analytics',
'value' => "",
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'header_scripts',
'value' => "",
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'body_scripts',
'value' => "",
'created_at' => now(),
'updated_at' => now()
],
[
'key' => "appstore_user",
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => "playstore_user",
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'playstore_stardom',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'facebook_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'linkedin_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'twitter_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'pinterest_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'instagram_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'snapchat_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'youtube_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'twitch_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'telegram_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'discord_link',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'meta_title',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'meta_description',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'meta_author',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'meta_keywords',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'FCM_SENDER_ID',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'FCM_SECRET_KEY',
'value' => '',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'admin_commission',
'value' => 20,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'MAILGUN_PUBLIC_KEY',
'value' => "",
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 's3_bucket',
'value' => NO,
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'google_api_key',
'value' => 'AIzaSyAfDkN9CGZJnwWXA93dH1EUnLgDkA-ohKg',
'created_at' => now(),
'updated_at' => now()
],
[
'key' => 'stripe_publishable_key',
'value' => 'pk_test_uDYrTXzzAuGRwDYtu7dkhaF3',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'stripe_secret_key',
'value' => 'sk_test_lRUbYflDyRP3L2UbnsehTUHW',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'demo_admin_email',
'value' => 'demo@demo.com',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'demo_admin_password',
'value' => 'demo123',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'demo_user_email',
'value' => 'demo@demo.com',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'demo_user_password',
'value' => 'demo123',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'token_symbol',
'value' => 'PSCN',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'symbol_position',
'value' => SUFFIX,
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'footer_description',
'value' => '',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'notification_email',
'value' => 'demo@demo.com',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'sitemap_email',
'value' => 'demo@demo.com',
'created_at' => now(),
'updated_at' => now(),
],
[
'key' => 'sitemap_date',
'value' => now(IST_TIMEZONE)->addDays(3)->format('Y-m-d'),
'created_at' => now(),
'updated_at' => now(),
]
]);
if(Schema::hasTable('settings')) {
// Check already keys are updated
$social_logins = json_decode(json_encode(['FB_CLIENT_ID', 'FB_CLIENT_SECRET', 'FB_CALL_BACK' , 'TWITTER_CLIENT_ID', 'TWITTER_CLIENT_SECRET', 'TWITTER_CALL_BACK', 'GOOGLE_CLIENT_ID', 'GOOGLE_CLIENT_SECRET', 'GOOGLE_CALL_BACK']));
foreach ($social_logins as $key => $value) {
$details = DB::table('settings')->where('key' ,$value)->count();
if(!$details) {
DB::table('settings')->insert([
[
'key' => $value,
'value' => "",
'created_at' => now(),
'updated_at' => now()
],
]);
}
}
}
}
}
Back to Directory
File Manager