diff --git a/app/Models/DateFormat.php b/app/Models/DateFormat.php index 80d1a18abf2c..87b560c6f215 100644 --- a/app/Models/DateFormat.php +++ b/app/Models/DateFormat.php @@ -7,6 +7,33 @@ namespace App\Models; */ class DateFormat extends StaticModel { + + public static $days_of_the_week = [ + 0 => 'sunday', + 1 => 'monday', + 2 => 'tuesday', + 3 => 'wednesday', + 4 => 'thursday', + 5 => 'friday', + 6 => 'saturday', + ]; + + public static $months_of_the_years = [ + 0 => 'january', + 1 => 'february', + 2 => 'march', + 3 => 'april', + 4 => 'may', + 5 => 'june', + 6 => 'july', + 7 => 'august', + 8 => 'september', + 9 => 'october', + 10 => 'november', + 11 => 'december', + ]; + + /** * @var bool */ diff --git a/app/Models/Gateway.php b/app/Models/Gateway.php index 32d6bcda6a36..05138a55ed98 100644 --- a/app/Models/Gateway.php +++ b/app/Models/Gateway.php @@ -20,9 +20,11 @@ class Gateway extends StaticModel protected $casts = [ 'is_offsite' => 'boolean', 'is_secure' => 'boolean', + 'recommended' => 'boolean', + 'visible' => 'boolean', 'updated_at' => 'timestamp', 'created_at' => 'timestamp', - 'deleted_at' => 'timestamp', + 'fields' => 'json', ]; /** diff --git a/app/Models/PaymentLibrary.php b/app/Models/PaymentLibrary.php index 2a31a5960dd6..a17026bc373a 100644 --- a/app/Models/PaymentLibrary.php +++ b/app/Models/PaymentLibrary.php @@ -26,12 +26,5 @@ class PaymentLibrary extends BaseModel 'deleted_at' => 'timestamp', ]; - /** - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function gateways() - { - return $this->hasMany(Gateway::class, 'payment_library_id'); - } } 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 9902cede08d9..37dd907240ec 100644 --- a/database/migrations/2014_10_13_000000_create_users_table.php +++ b/database/migrations/2014_10_13_000000_create_users_table.php @@ -82,7 +82,13 @@ class CreateUsersTable extends Migration $table->string('key')->unique(); $table->string('provider'); $table->boolean('visible')->default(true); - $table->timestamps(); + $table->unsignedInteger('sort_order')->default(10000); + $table->boolean('recommended')->default(0); + $table->string('site_url', 200)->nullable(); + $table->boolean('is_offsite')->default(false); + $table->boolean('is_secure')->default(false); + $table->text('fields')->nullable(); + $table->timestamps(6); }); Schema::create('accounts', function ($table) { @@ -756,21 +762,6 @@ class CreateUsersTable extends Migration $t->boolean('visible')->default(true); }); - Schema::table('gateways', function ($table) { - $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->boolean('is_offsite')->default(false); - $table->boolean('is_secure')->default(false); - $table->text('fields')->nullable(); - }); - - DB::table('gateways')->update(['payment_library_id' => 1]); - - Schema::table('gateways', function ($table) { - $table->foreign('payment_library_id')->references('id')->on('payment_libraries')->onDelete('cascade'); - }); Schema::create('tasks', function ($table) { $table->increments('id');