This commit is contained in:
David Bomba 2019-09-17 20:27:48 +10:00
parent 5211434d49
commit 70d146333b
8 changed files with 36 additions and 6 deletions

View File

@ -43,7 +43,6 @@ class StartupCheck
if (Input::has('clear_cache')) if (Input::has('clear_cache'))
Session::flash('message', 'Cache cleared'); Session::flash('message', 'Cache cleared');
foreach ($cached_tables as $name => $class) { foreach ($cached_tables as $name => $class) {
if (Input::has('clear_cache') || ! Cache::has($name)) { if (Input::has('clear_cache') || ! Cache::has($name)) {
// check that the table exists in case the migration is pending // check that the table exists in case the migration is pending

View File

@ -68,6 +68,9 @@ class Activity extends StaticModel
const DELETE_USER=51; const DELETE_USER=51;
const RESTORE_USER=52; const RESTORE_USER=52;
protected $casts = [
'is_system' => 'boolean',
];
public function backup() public function backup()
{ {

View File

@ -17,6 +17,12 @@ class Country extends StaticModel
{ {
public $timestamps = false; public $timestamps = false;
protected $casts = [
'eea' => 'boolean',
'swap_postal_code' => 'boolean',
'swap_currency_symbol' => 'boolean',
];
/** /**
* Localizes the country name for the clients language. * Localizes the country name for the clients language.
* *
@ -26,4 +32,7 @@ class Country extends StaticModel
{ {
return trans('texts.country_' . $this->name); return trans('texts.country_' . $this->name);
} }
} }

View File

@ -17,4 +17,8 @@ class Currency extends StaticModel
{ {
public $timestamps = false; public $timestamps = false;
protected $casts = [
'swap_currency_symbol' => 'boolean',
];
} }

View File

@ -17,6 +17,11 @@ use Omnipay\Omnipay;
class Gateway extends StaticModel class Gateway extends StaticModel
{ {
protected $casts = [
'is_offsite' => 'boolean',
'is_secure' => 'boolean',
];
/** /**
* @return mixed * @return mixed
*/ */

View File

@ -19,6 +19,10 @@ use Illuminate\Database\Eloquent\Model;
class PaymentLibrary extends BaseModel class PaymentLibrary extends BaseModel
{ {
protected $casts = [
'visible' => 'boolean',
];
/** /**
* @return \Illuminate\Database\Eloquent\Relations\HasMany * @return \Illuminate\Database\Eloquent\Relations\HasMany
*/ */
@ -26,4 +30,5 @@ class PaymentLibrary extends BaseModel
{ {
return $this->hasMany(Gateway::class, 'payment_library_id'); return $this->hasMany(Gateway::class, 'payment_library_id');
} }
} }

View File

@ -52,10 +52,15 @@ class StripePaymentDriver extends BasePaymentDriver
*/ */
/************************************** Stripe API methods **********************************************************/ /************************************** Stripe API methods **********************************************************/
public function init() /**
* Initializes the Stripe API
* @return void
*/
public function init() :void
{ {
Stripe::setApiKey($this->company_gateway->getConfigField('23_apiKey')); Stripe::setApiKey($this->company_gateway->getConfigField('23_apiKey'));
} }
/** /**
* Returns the gateway types * Returns the gateway types
*/ */

View File

@ -213,9 +213,9 @@ class CreateUsersTable extends Migration
$table->integer('theme_id')->nullable(); $table->integer('theme_id')->nullable();
$table->smallInteger('failed_logins')->nullable(); $table->smallInteger('failed_logins')->nullable();
$table->string('referral_code')->default(''); $table->string('referral_code')->default('');
$table->string('oauth_user_id',100)->default(''); $table->string('oauth_user_id',100)->nullable();
$table->string('oauth_provider_id')->default(''); $table->string('oauth_provider_id')->nullable();
$table->string('google_2fa_secret')->default(''); $table->string('google_2fa_secret')->nullable();
$table->string('accepted_terms_version')->default(''); $table->string('accepted_terms_version')->default('');
$table->string('avatar', 100)->default(''); $table->string('avatar', 100)->default('');
$table->unsignedInteger('avatar_width')->nullable(); $table->unsignedInteger('avatar_width')->nullable();
@ -739,7 +739,7 @@ class CreateUsersTable extends Migration
$table->unsignedInteger('payment_library_id')->default(1); $table->unsignedInteger('payment_library_id')->default(1);
$table->unsignedInteger('sort_order')->default(10000); $table->unsignedInteger('sort_order')->default(10000);
$table->boolean('recommended')->default(0); $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_offsite')->default(false);
$table->boolean('is_secure')->default(false); $table->boolean('is_secure')->default(false);
}); });