6 changed files with 119 additions and 1 deletions
-
18app/Http/Controllers/UsersController.php
-
5app/Http/Requests/Users/UpdateRequest.php
-
12app/UserMetadata.php
-
34database/migrations/2021_04_04_215601_create_user_metadata_table.php
-
4resources/views/users/partials/edit_death.blade.php
-
47tests/Feature/UsersProfileTest.php
@ -0,0 +1,12 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App; |
||||
|
|
||||
|
use Illuminate\Database\Eloquent\Model; |
||||
|
|
||||
|
class UserMetadata extends Model |
||||
|
{ |
||||
|
public $incrementing = false; |
||||
|
|
||||
|
protected $keyType = 'string'; |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use Illuminate\Database\Migrations\Migration; |
||||
|
use Illuminate\Database\Schema\Blueprint; |
||||
|
use Illuminate\Support\Facades\Schema; |
||||
|
|
||||
|
class CreateUserMetadataTable extends Migration |
||||
|
{ |
||||
|
/** |
||||
|
* Run the migrations. |
||||
|
* |
||||
|
* @return void |
||||
|
*/ |
||||
|
public function up() |
||||
|
{ |
||||
|
Schema::create('user_metadata', function (Blueprint $table) { |
||||
|
$table->uuid('id')->primary(); |
||||
|
$table->foreignId('user_id')->constrained('users')->onDelete('cascade'); |
||||
|
$table->string('name')->index(); |
||||
|
$table->text('value'); |
||||
|
$table->timestamps(); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Reverse the migrations. |
||||
|
* |
||||
|
* @return void |
||||
|
*/ |
||||
|
public function down() |
||||
|
{ |
||||
|
Schema::dropIfExists('user_metadata'); |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue