Skip to content

Commit

Permalink
Merge pull request #13 from SouJunior/gerenciamento-de-usuário-criar-…
Browse files Browse the repository at this point in the history
…campos-adicionais---tabela

Tabela Users - Adicionado campos de cidade, estado e perfil do discord
  • Loading branch information
mgescobar authored Dec 9, 2024
2 parents 509d273 + 846c2ec commit 772055d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class User extends Authenticatable
'name',
'email',
'password',
'city',
'state',
'linkedin',
'discord',
'permission',
];

Expand Down
5 changes: 4 additions & 1 deletion database/migrations/2024_01_25_210912_create_users_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ public function up(): void
$table->string('name', 60);
$table->string('email', 60)->unique();
$table->string('password');
$table->string('linkedin')->nullable();
$table->string('city', 60)->nullable();
$table->string('state', 20)->nullable();
$table->string('linkedin', 101)->nullable()->unique();
$table->string('discord', 33)->nullable()->unique();
$table->string('permission')->nullable();
$table->integer('active')->nullable()->default(1);
$table->rememberToken();
Expand Down
31 changes: 31 additions & 0 deletions database/migrations/2024_11_29_185241_add_new_fields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('city', 60)->nullable();
$table->string('state', 20)->nullable();
$table->string('linkedin', 101)->nullable()->unique();
$table->string('discord', 33)->nullable()->unique();
});
}

/**
* Reverse the migrations.
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['city', 'state', 'linkedin', 'discord']);
});
}
};

0 comments on commit 772055d

Please sign in to comment.