mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
implementation of user limits and refactoring
This commit is contained in:
@@ -29,11 +29,7 @@ class UserFactory extends Factory
|
||||
'email_verified_at' => now(),
|
||||
'password' => bcrypt('secret'),
|
||||
'remember_token' => Str::random(10),
|
||||
'created_at' => $this->faker->dateTimeBetween(
|
||||
$startDate = '-36 months',
|
||||
$endDate = 'now',
|
||||
$timezone = null
|
||||
),
|
||||
'created_at' => $this->faker->dateTimeBetween('-36 months', 'now', null),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -48,7 +44,6 @@ class UserFactory extends Factory
|
||||
$user
|
||||
->settings()
|
||||
->create([
|
||||
'max_storage_amount' => $this->faker->randomNumber(1),
|
||||
'name' => $this->faker->name,
|
||||
'address' => $this->faker->address,
|
||||
'state' => $this->faker->state,
|
||||
|
||||
@@ -19,6 +19,8 @@ class CreateUsersTable extends Migration
|
||||
$table->string('email')->unique()->index();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->text('two_factor_secret')->nullable();
|
||||
$table->text('two_factor_recovery_codes')->nullable();
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
$table->charset = 'utf8mb4';
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTwoFactorColumnsToUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->text('two_factor_secret')
|
||||
->after('password')
|
||||
->nullable();
|
||||
|
||||
$table->text('two_factor_recovery_codes')
|
||||
->after('two_factor_secret')
|
||||
->nullable();
|
||||
|
||||
$table->charset = 'utf8mb4';
|
||||
$table->collation = 'utf8mb4_unicode_ci';
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('two_factor_secret', 'two_factor_recovery_codes');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCustomerColumns extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('stripe_id')->nullable()->index();
|
||||
$table->string('card_brand')->nullable();
|
||||
$table->string('card_last_four', 4)->nullable();
|
||||
$table->timestamp('trial_ends_at')->nullable();
|
||||
$table->charset = 'utf8mb4';
|
||||
$table->collation = 'utf8mb4_unicode_ci';
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'stripe_id',
|
||||
'card_brand',
|
||||
'card_last_four',
|
||||
'trial_ends_at',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateFileManagerFolders extends Migration
|
||||
class CreateFoldersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateFileManagerFiles extends Migration
|
||||
class CreateFilesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -15,7 +15,6 @@ class CreateUserSettingsTable extends Migration
|
||||
{
|
||||
Schema::create('user_settings', function (Blueprint $table) {
|
||||
$table->uuid('user_id')->index();
|
||||
$table->integer('max_storage_amount')->default(5);
|
||||
$table->string('avatar')->nullable();
|
||||
$table->string('color')->nullable();
|
||||
$table->text('name')->nullable();
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUserLimitationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('user_limitations', function (Blueprint $table) {
|
||||
$table->uuid('user_id');
|
||||
$table->text('max_storage_amount');
|
||||
$table->text('max_team_members');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('user_limitations');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user