@@ -1,67 +1,67 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Models; |
|
| 3 | + namespace App\Models; |
|
| 4 | 4 | |
| 5 | -use Sofa\Eloquence\Eloquence; |
|
| 6 | -use Sofa\Eloquence\Mappable; |
|
| 5 | + use Sofa\Eloquence\Eloquence; |
|
| 6 | + use Sofa\Eloquence\Mappable; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Class PaymentMethod. |
| 10 | 10 | */ |
| 11 | -class PaymentMethod extends ChocolateyModel |
|
| 12 | -{ |
|
| 13 | - use Eloquence, Mappable; |
|
| 11 | + class PaymentMethod extends ChocolateyModel |
|
| 12 | + { |
|
| 13 | + use Eloquence, Mappable; |
|
| 14 | 14 | |
| 15 | - /** |
|
| 15 | + /** |
|
| 16 | 16 | * Disable Timestamps. |
| 17 | 17 | * |
| 18 | 18 | * @var bool |
| 19 | 19 | */ |
| 20 | - public $timestamps = false; |
|
| 20 | + public $timestamps = false; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 22 | + /** |
|
| 23 | 23 | * Purchase Params. |
| 24 | 24 | * |
| 25 | 25 | * @var PurchaseParam |
| 26 | 26 | */ |
| 27 | - public $purchaseParams = null; |
|
| 27 | + public $purchaseParams = null; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 29 | + /** |
|
| 30 | 30 | * The table associated with the model. |
| 31 | 31 | * |
| 32 | 32 | * @var string |
| 33 | 33 | */ |
| 34 | - protected $table = 'chocolatey_shop_payment_methods'; |
|
| 34 | + protected $table = 'chocolatey_shop_payment_methods'; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 36 | + /** |
|
| 37 | 37 | * Primary Key of the Table. |
| 38 | 38 | * |
| 39 | 39 | * @var string |
| 40 | 40 | */ |
| 41 | - protected $primaryKey = 'id'; |
|
| 41 | + protected $primaryKey = 'id'; |
|
| 42 | 42 | |
| 43 | - /** |
|
| 43 | + /** |
|
| 44 | 44 | * The Appender(s) of the Model. |
| 45 | 45 | * |
| 46 | 46 | * @var array |
| 47 | 47 | */ |
| 48 | - protected $appends = ['disclaimerRequired', 'premiumSms', 'purchaseParams', 'requestPath']; |
|
| 48 | + protected $appends = ['disclaimerRequired', 'premiumSms', 'purchaseParams', 'requestPath']; |
|
| 49 | 49 | |
| 50 | - /** |
|
| 50 | + /** |
|
| 51 | 51 | * The attributes excluded from the model's JSON form. |
| 52 | 52 | * |
| 53 | 53 | * @var array |
| 54 | 54 | */ |
| 55 | - protected $hidden = ['disclaimer']; |
|
| 55 | + protected $hidden = ['disclaimer']; |
|
| 56 | 56 | |
| 57 | - /** |
|
| 57 | + /** |
|
| 58 | 58 | * The attributes that will be mapped. |
| 59 | 59 | * |
| 60 | 60 | * @var array |
| 61 | 61 | */ |
| 62 | - protected $maps = ['disclaimerRequired' => 'disclaimer']; |
|
| 62 | + protected $maps = ['disclaimerRequired' => 'disclaimer']; |
|
| 63 | 63 | |
| 64 | - /** |
|
| 64 | + /** |
|
| 65 | 65 | * Store an Shop Country. |
| 66 | 66 | * |
| 67 | 67 | * @param string $methodName |
@@ -71,76 +71,76 @@ discard block |
||
| 71 | 71 | * |
| 72 | 72 | * @return PaymentMethod |
| 73 | 73 | */ |
| 74 | - public function store(string $methodName, string $code, string $buttonImageUrl, string $buttonText): PaymentMethod |
|
| 75 | - { |
|
| 76 | - $this->attributes['name'] = $methodName; |
|
| 77 | - $this->attributes['buttonLogoUrl'] = $buttonImageUrl; |
|
| 78 | - $this->attributes['buttonText'] = $buttonText; |
|
| 79 | - $this->attributes['localizationKey'] = $code; |
|
| 80 | - $this->timestamps = false; |
|
| 74 | + public function store(string $methodName, string $code, string $buttonImageUrl, string $buttonText): PaymentMethod |
|
| 75 | + { |
|
| 76 | + $this->attributes['name'] = $methodName; |
|
| 77 | + $this->attributes['buttonLogoUrl'] = $buttonImageUrl; |
|
| 78 | + $this->attributes['buttonText'] = $buttonText; |
|
| 79 | + $this->attributes['localizationKey'] = $code; |
|
| 80 | + $this->timestamps = false; |
|
| 81 | 81 | |
| 82 | - $this->save(); |
|
| 82 | + $this->save(); |
|
| 83 | 83 | |
| 84 | - return $this; |
|
| 85 | - } |
|
| 84 | + return $this; |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - /** |
|
| 87 | + /** |
|
| 88 | 88 | * Get Disclaimer Required Attribute. |
| 89 | 89 | * |
| 90 | 90 | * @return bool |
| 91 | 91 | */ |
| 92 | - public function getDisclaimerRequiredAttribute(): bool |
|
| 93 | - { |
|
| 94 | - return $this->attributes['disclaimer'] == 1; |
|
| 95 | - } |
|
| 92 | + public function getDisclaimerRequiredAttribute(): bool |
|
| 93 | + { |
|
| 94 | + return $this->attributes['disclaimer'] == 1; |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - /** |
|
| 97 | + /** |
|
| 98 | 98 | * Get Premium SMS Attribute. |
| 99 | 99 | * |
| 100 | 100 | * @return bool |
| 101 | 101 | */ |
| 102 | - public function getPremiumSmsAttribute(): bool |
|
| 103 | - { |
|
| 104 | - return false; |
|
| 105 | - } |
|
| 102 | + public function getPremiumSmsAttribute(): bool |
|
| 103 | + { |
|
| 104 | + return false; |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | - /** |
|
| 107 | + /** |
|
| 108 | 108 | * Get Request Path Attribute. |
| 109 | 109 | * |
| 110 | 110 | * @return string |
| 111 | 111 | */ |
| 112 | - public function getRequestPathAttribute(): string |
|
| 113 | - { |
|
| 114 | - return 'online'; |
|
| 115 | - } |
|
| 112 | + public function getRequestPathAttribute(): string |
|
| 113 | + { |
|
| 114 | + return 'online'; |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - /** |
|
| 117 | + /** |
|
| 118 | 118 | * Get the Purchase Params. |
| 119 | 119 | * |
| 120 | 120 | * @return PurchaseParam |
| 121 | 121 | */ |
| 122 | - public function getPurchaseParamsAttribute(): PurchaseParam |
|
| 123 | - { |
|
| 124 | - return $this->purchaseParams; |
|
| 125 | - } |
|
| 122 | + public function getPurchaseParamsAttribute(): PurchaseParam |
|
| 123 | + { |
|
| 124 | + return $this->purchaseParams; |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - /** |
|
| 127 | + /** |
|
| 128 | 128 | * Set Purchase Params. |
| 129 | 129 | * |
| 130 | 130 | * @param array $parameters |
| 131 | 131 | */ |
| 132 | - public function setPurchaseParams(array $parameters) |
|
| 133 | - { |
|
| 134 | - $this->purchaseParams = new PurchaseParam($parameters[0], $parameters[1], $this->attributes['id']); |
|
| 135 | - } |
|
| 132 | + public function setPurchaseParams(array $parameters) |
|
| 133 | + { |
|
| 134 | + $this->purchaseParams = new PurchaseParam($parameters[0], $parameters[1], $this->attributes['id']); |
|
| 135 | + } |
|
| 136 | 136 | |
| 137 | - /** |
|
| 137 | + /** |
|
| 138 | 138 | * Get Category Payment Type. |
| 139 | 139 | * |
| 140 | 140 | * @return string |
| 141 | 141 | */ |
| 142 | - public function getCategoryAttribute(): string |
|
| 143 | - { |
|
| 144 | - return PaymentCategory::find($this->attributes['category'])->payment_type; |
|
| 145 | - } |
|
| 142 | + public function getCategoryAttribute(): string |
|
| 143 | + { |
|
| 144 | + return PaymentCategory::find($this->attributes['category'])->payment_type; |
|
| 145 | + } |
|
| 146 | 146 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - Mail::send($view, $configuration, function ($message) use ($configuration) { |
|
| 27 | + Mail::send($view, $configuration, function($message) use ($configuration) { |
|
| 28 | 28 | $message->from(Config::get('mail.from.address'), Config::get('mail.from.name')); |
| 29 | 29 | $message->to($configuration['email'])->subject($configuration['subject']); |
| 30 | 30 | }); |
@@ -1,30 +1,30 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Models; |
|
| 3 | + namespace App\Models; |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Class Permissions. |
| 7 | 7 | */ |
| 8 | -class Permissions extends ChocolateyModel |
|
| 9 | -{ |
|
| 10 | - /** |
|
| 8 | + class Permissions extends ChocolateyModel |
|
| 9 | + { |
|
| 10 | + /** |
|
| 11 | 11 | * Disable Timestamps. |
| 12 | 12 | * |
| 13 | 13 | * @var bool |
| 14 | 14 | */ |
| 15 | - public $timestamps = false; |
|
| 15 | + public $timestamps = false; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * The table associated with the model. |
| 19 | 19 | * |
| 20 | 20 | * @var string |
| 21 | 21 | */ |
| 22 | - protected $table = 'permissions'; |
|
| 22 | + protected $table = 'permissions'; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | + /** |
|
| 25 | 25 | * Primary Key of the Table. |
| 26 | 26 | * |
| 27 | 27 | * @var string |
| 28 | 28 | */ |
| 29 | - protected $primaryKey = 'id'; |
|
| 29 | + protected $primaryKey = 'id'; |
|
| 30 | 30 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | Storage::put('.env', 'APP_ENV=production'); |
| 69 | 69 | |
| 70 | 70 | $this->comment('[INFO] Generating Chocolatey encryption key for password hashing...'); |
| 71 | - Storage::append('.env', 'APP_KEY='.bin2hex(openssl_random_pseudo_bytes(20))); |
|
| 71 | + Storage::append('.env', 'APP_KEY=' . bin2hex(openssl_random_pseudo_bytes(20))); |
|
| 72 | 72 | |
| 73 | 73 | $this->comment('[INFO] Setting Chocolatey debug mode to false...'); |
| 74 | 74 | Storage::append('.env', 'APP_DEBUG=false'); |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | Storage::append('.env', 'DB_CONNECTION=mysql'); |
| 81 | 81 | |
| 82 | 82 | $this->comment('[INFO] Appending all database credentials to .env file...'); |
| 83 | - Storage::append('.env', 'DB_HOST='.$DB_HOST); |
|
| 84 | - Storage::append('.env', 'DB_PORT='.$DB_PORT); |
|
| 85 | - Storage::append('.env', 'DB_DATABASE='.$DB_NAME); |
|
| 86 | - Storage::append('.env', 'DB_USERNAME='.$DB_USER); |
|
| 87 | - Storage::append('.env', 'DB_PASSWORD='.$DB_PASS); |
|
| 83 | + Storage::append('.env', 'DB_HOST=' . $DB_HOST); |
|
| 84 | + Storage::append('.env', 'DB_PORT=' . $DB_PORT); |
|
| 85 | + Storage::append('.env', 'DB_DATABASE=' . $DB_NAME); |
|
| 86 | + Storage::append('.env', 'DB_USERNAME=' . $DB_USER); |
|
| 87 | + Storage::append('.env', 'DB_PASSWORD=' . $DB_PASS); |
|
| 88 | 88 | Storage::append('.env', ''); |
| 89 | 89 | |
| 90 | 90 | $this->comment('[DRIVERS] Setting broadcast to log...'); |