mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Casts
This commit is contained in:
parent
5211434d49
commit
70d146333b
@ -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
|
||||
|
@ -68,6 +68,9 @@ class Activity extends StaticModel
|
||||
const DELETE_USER=51;
|
||||
const RESTORE_USER=52;
|
||||
|
||||
protected $casts = [
|
||||
'is_system' => 'boolean',
|
||||
];
|
||||
|
||||
public function backup()
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,4 +17,8 @@ class Currency extends StaticModel
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'swap_currency_symbol' => 'boolean',
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -17,6 +17,11 @@ use Omnipay\Omnipay;
|
||||
class Gateway extends StaticModel
|
||||
{
|
||||
|
||||
protected $casts = [
|
||||
'is_offsite' => 'boolean',
|
||||
'is_secure' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user