diff --git a/app/Http/Middleware/StartupCheck.php b/app/Http/Middleware/StartupCheck.php index 3a356bad854b..e4072784ead9 100644 --- a/app/Http/Middleware/StartupCheck.php +++ b/app/Http/Middleware/StartupCheck.php @@ -43,7 +43,6 @@ class StartupCheck if (Input::has('clear_cache')) Session::flash('message', 'Cache cleared'); - foreach ($cached_tables as $name => $class) { if (Input::has('clear_cache') || ! Cache::has($name)) { // check that the table exists in case the migration is pending diff --git a/app/Models/Activity.php b/app/Models/Activity.php index 002a2ae6ddc8..14d04325fe82 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -68,6 +68,9 @@ class Activity extends StaticModel const DELETE_USER=51; const RESTORE_USER=52; + protected $casts = [ + 'is_system' => 'boolean', + ]; public function backup() { diff --git a/app/Models/Country.php b/app/Models/Country.php index 79556d5f6c24..1578db2874b2 100644 --- a/app/Models/Country.php +++ b/app/Models/Country.php @@ -17,6 +17,12 @@ class Country extends StaticModel { public $timestamps = false; + protected $casts = [ + 'eea' => 'boolean', + 'swap_postal_code' => 'boolean', + 'swap_currency_symbol' => 'boolean', + ]; + /** * Localizes the country name for the clients language. * @@ -26,4 +32,7 @@ class Country extends StaticModel { return trans('texts.country_' . $this->name); } + + } + diff --git a/app/Models/Currency.php b/app/Models/Currency.php index d45727de7332..79c4bfd04e1b 100644 --- a/app/Models/Currency.php +++ b/app/Models/Currency.php @@ -17,4 +17,8 @@ class Currency extends StaticModel { public $timestamps = false; + protected $casts = [ + 'swap_currency_symbol' => 'boolean', + ]; + } diff --git a/app/Models/Gateway.php b/app/Models/Gateway.php index b1ae677caac6..1cc1dd03e772 100644 --- a/app/Models/Gateway.php +++ b/app/Models/Gateway.php @@ -17,6 +17,11 @@ use Omnipay\Omnipay; class Gateway extends StaticModel { + protected $casts = [ + 'is_offsite' => 'boolean', + 'is_secure' => 'boolean', + ]; + /** * @return mixed */ diff --git a/app/Models/PaymentLibrary.php b/app/Models/PaymentLibrary.php index 87e1d9357d05..28cb2cdf9440 100644 --- a/app/Models/PaymentLibrary.php +++ b/app/Models/PaymentLibrary.php @@ -19,6 +19,10 @@ use Illuminate\Database\Eloquent\Model; class PaymentLibrary extends BaseModel { + protected $casts = [ + 'visible' => 'boolean', + ]; + /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ @@ -26,4 +30,5 @@ class PaymentLibrary extends BaseModel { return $this->hasMany(Gateway::class, 'payment_library_id'); } + } diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index a68ee179de46..3763f08efa47 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -52,10 +52,15 @@ class StripePaymentDriver extends BasePaymentDriver */ /************************************** Stripe API methods **********************************************************/ - public function init() + /** + * Initializes the Stripe API + * @return void + */ + public function init() :void { Stripe::setApiKey($this->company_gateway->getConfigField('23_apiKey')); } + /** * Returns the gateway types */ diff --git a/database/migrations/2014_10_13_000000_create_users_table.php b/database/migrations/2014_10_13_000000_create_users_table.php index e2cb6928a524..a9ec682dff4e 100644 --- a/database/migrations/2014_10_13_000000_create_users_table.php +++ b/database/migrations/2014_10_13_000000_create_users_table.php @@ -213,9 +213,9 @@ class CreateUsersTable extends Migration $table->integer('theme_id')->nullable(); $table->smallInteger('failed_logins')->nullable(); $table->string('referral_code')->default(''); - $table->string('oauth_user_id',100)->default(''); - $table->string('oauth_provider_id')->default(''); - $table->string('google_2fa_secret')->default(''); + $table->string('oauth_user_id',100)->nullable(); + $table->string('oauth_provider_id')->nullable(); + $table->string('google_2fa_secret')->nullable(); $table->string('accepted_terms_version')->default(''); $table->string('avatar', 100)->default(''); $table->unsignedInteger('avatar_width')->nullable(); @@ -739,7 +739,7 @@ class CreateUsersTable extends Migration $table->unsignedInteger('payment_library_id')->default(1); $table->unsignedInteger('sort_order')->default(10000); $table->boolean('recommended')->default(0); - $table->string('site_url', 200)->nullable(); + $table->string('site_url', 200)->default(''); $table->boolean('is_offsite')->default(false); $table->boolean('is_secure')->default(false); });