mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
splitted user name
This commit is contained in:
@@ -31,34 +31,7 @@ class UserFactory extends Factory
|
||||
'email_verified_at' => now(),
|
||||
'password' => bcrypt('secret'),
|
||||
'remember_token' => Str::random(10),
|
||||
'created_at' => $this->faker->dateTimeBetween('-36 months', 'now', null),
|
||||
'created_at' => $this->faker->dateTimeBetween('-36 months'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the model factory.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function configure()
|
||||
{
|
||||
return $this->afterCreating(function (User $user) {
|
||||
$user
|
||||
->settings()
|
||||
->create([
|
||||
'name' => $this->faker->name,
|
||||
'address' => $this->faker->address,
|
||||
'state' => $this->faker->state,
|
||||
'city' => $this->faker->city,
|
||||
'postal_code' => $this->faker->postcode,
|
||||
'country' => $this->faker->randomElement(
|
||||
['SK', 'CZ', 'DE', 'FR']
|
||||
),
|
||||
'phone_number' => $this->faker->phoneNumber,
|
||||
'timezone' => $this->faker->randomElement(
|
||||
['+1.0', '+2.0', '+3.0']
|
||||
),
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
45
database/factories/UserSettingFactory.php
Normal file
45
database/factories/UserSettingFactory.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Users\Models\UserSetting;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class UserSettingFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = UserSetting::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'id' => $this->faker->uuid,
|
||||
'user_id' => $this->faker->uuid,
|
||||
'first_name' => $this->faker->name,
|
||||
'last_name' => $this->faker->lastName,
|
||||
'address' => $this->faker->address,
|
||||
'state' => $this->faker->state,
|
||||
'city' => $this->faker->city,
|
||||
'postal_code' => $this->faker->postcode,
|
||||
'phone_number' => $this->faker->phoneNumber,
|
||||
'color' => $this->faker->randomElement(
|
||||
config('vuefilemanager.colors')
|
||||
),
|
||||
'country' => $this->faker->randomElement(
|
||||
['SK', 'CZ', 'DE', 'FR']
|
||||
),
|
||||
'timezone' => $this->faker->randomElement(
|
||||
['+1.0', '+2.0', '+3.0']
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,8 @@ class CreateUsersTable extends Migration
|
||||
$table->enum('role', ['admin', 'user'])->default('user');
|
||||
$table->string('email')->unique()->index();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->string('oauth_provider')->nullable();
|
||||
$table->string('password')->nullable();
|
||||
$table->text('two_factor_secret')->nullable();
|
||||
$table->text('two_factor_recovery_codes')->nullable();
|
||||
$table->rememberToken();
|
||||
|
||||
@@ -18,7 +18,8 @@ class CreateUserSettingsTable extends Migration
|
||||
$table->uuid('user_id')->index();
|
||||
$table->string('avatar')->nullable();
|
||||
$table->string('color')->nullable();
|
||||
$table->text('name')->nullable();
|
||||
$table->text('first_name')->nullable();
|
||||
$table->text('last_name')->nullable();
|
||||
$table->text('address')->nullable();
|
||||
$table->text('state')->nullable();
|
||||
$table->text('city')->nullable();
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddOauthProviderToUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('oauth_provider')->nullable();
|
||||
$table->string('password')->nullable()->change();
|
||||
|
||||
$table->charset = 'utf8mb4';
|
||||
$table->collation = 'utf8mb4_unicode_ci';
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user