EnvSettingController.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Helpers\File;
  4. class EnvSettingController
  5. {
  6. public function setGeneralInfo()
  7. {
  8. File::changeEnvironmentVariable('ERP_PARA_CUSTOM_THEME', request('ErpParaCustomTheme'));
  9. File::changeEnvironmentVariable('ERP_THEMES', request('ErpThemes'), true);
  10. File::changeEnvironmentVariable('PRO_THEME', request('ProTheme'));
  11. File::changeEnvironmentVariable('LOCALE_SEQUENCE', request('LocaleSequence'), true);
  12. File::changeEnvironmentVariable('APP_NAME', request('AppName'));
  13. File::changeEnvironmentVariable('APP_ENV', request('AppEnv'));
  14. File::changeEnvironmentVariable('APP_DEBUG', request('AppDebug'));
  15. File::changeEnvironmentVariable('APP_URL', request('AppUrl'));
  16. File::changeEnvironmentVariable('MAIL_MAILER', request('MailMailer'));
  17. File::changeEnvironmentVariable('MAIL_HOST', request('MailHost'));
  18. File::changeEnvironmentVariable('MAIL_PORT', request('MailPort'));
  19. File::changeEnvironmentVariable('MAIL_USERNAME', request('MailUserName'));
  20. File::changeEnvironmentVariable('MAIL_PASSWORD', request('MailPassword'));
  21. File::changeEnvironmentVariable('MAIL_ENCRYPTION', request('MailEncryption'));
  22. File::changeEnvironmentVariable('MAIL_FROM_ADDRESS', request('MailFromAddress'));
  23. File::changeEnvironmentVariable('CDN_TYPE', request('CdnType'));
  24. File::changeEnvironmentVariable('MEDIA_URL', request('MediaUrl'));
  25. File::changeEnvironmentVariable('FAVICON_PATH', request('FaviconPath'));
  26. File::changeEnvironmentVariable('TAG_LINE', request('TagLine'));
  27. File::changeEnvironmentVariable('APP_MOBILE_NO', request('AppMobileNo'));
  28. // File::changeEnvironmentVariable('IS_SKIP_DBUPDATE', request('IsSkipUpdate') === true ? '1' : '0');
  29. File::changeEnvironmentVariable('IS_SKIP_DBUPDATE', request('IsSkipUpdate'));
  30. File::changeEnvironmentVariable('IS_ON_MEMBER_SIGNUP', request('IsOnMemberSignup') === true ? '1' : '0');
  31. return response([], 200);
  32. }
  33. public function setAwsS3()
  34. {
  35. File::changeEnvironmentVariable('AWS_ACCESS_KEY_ID', request('AccessKeyId'), false, '.env.aws.s3');
  36. File::changeEnvironmentVariable('AWS_SECRET_ACCESS_KEY', request('SecretAccessKey'), false, '.env.aws.s3');
  37. File::changeEnvironmentVariable('AWS_DEFAULT_REGION', request('DefaultRegion'), false, '.env.aws.s3');
  38. File::changeEnvironmentVariable('AWS_BUCKET', request('Bucket'), false, '.env.aws.s3');
  39. return response([], 200);
  40. }
  41. public function setAligoTextSend()
  42. {
  43. File::changeEnvironmentVariable('SMS_TYPE', 'aligo');
  44. File::changeEnvironmentVariable('SMS_APIKEY', request('Key'));
  45. File::changeEnvironmentVariable('SMS_USER', request('UserId'));
  46. File::changeEnvironmentVariable('SMS_SENDER', request('Sender'));
  47. return response([], 200);
  48. }
  49. }