wip
This commit is contained in:
parent
312b6bed6e
commit
de1dcee423
@ -21,14 +21,18 @@ public function create(array $input): User
|
||||
{
|
||||
Validator::make($input, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'username' => ['required', 'string', 'max:255', 'unique:users'],
|
||||
'email' => ['required', 'string', 'email', 'max:255'],
|
||||
'phone' => ['required', 'regex:/(01)[0-9]{9}/'],
|
||||
'password' => $this->passwordRules(),
|
||||
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
|
||||
])->validate();
|
||||
|
||||
return User::create([
|
||||
'name' => $input['name'],
|
||||
'username' => $input['username'],
|
||||
'email' => $input['email'],
|
||||
'phone' => $input['phone'],
|
||||
'password' => Hash::make($input['password']),
|
||||
]);
|
||||
}
|
||||
|
14
app/Models/Enums/UserRole.php
Normal file
14
app/Models/Enums/UserRole.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Enums;
|
||||
|
||||
enum UserRole: int
|
||||
{
|
||||
case Guest = 0;
|
||||
case Admin = 1;
|
||||
case Radiologist = 2;
|
||||
case ReferringPhysician = 3;
|
||||
case Technologist = 4;
|
||||
case Patient = 5;
|
||||
case Other = 6;
|
||||
}
|
54
composer.lock
generated
54
composer.lock
generated
@ -594,16 +594,16 @@
|
||||
},
|
||||
{
|
||||
"name": "egulias/email-validator",
|
||||
"version": "4.0.2",
|
||||
"version": "4.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/egulias/EmailValidator.git",
|
||||
"reference": "ebaaf5be6c0286928352e054f2d5125608e5405e"
|
||||
"reference": "b115554301161fa21467629f1e1391c1936de517"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ebaaf5be6c0286928352e054f2d5125608e5405e",
|
||||
"reference": "ebaaf5be6c0286928352e054f2d5125608e5405e",
|
||||
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/b115554301161fa21467629f1e1391c1936de517",
|
||||
"reference": "b115554301161fa21467629f1e1391c1936de517",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -649,7 +649,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/egulias/EmailValidator/issues",
|
||||
"source": "https://github.com/egulias/EmailValidator/tree/4.0.2"
|
||||
"source": "https://github.com/egulias/EmailValidator/tree/4.0.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -657,7 +657,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-10-06T06:47:41+00:00"
|
||||
"time": "2024-12-27T00:36:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fruitcake/php-cors",
|
||||
@ -2736,16 +2736,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "3.8.3",
|
||||
"version": "3.8.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/briannesbitt/Carbon.git",
|
||||
"reference": "f01cfa96468f4c38325f507ab81a4f1d2cd93cfe"
|
||||
"reference": "129700ed449b1f02d70272d2ac802357c8c30c58"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/f01cfa96468f4c38325f507ab81a4f1d2cd93cfe",
|
||||
"reference": "f01cfa96468f4c38325f507ab81a4f1d2cd93cfe",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/129700ed449b1f02d70272d2ac802357c8c30c58",
|
||||
"reference": "129700ed449b1f02d70272d2ac802357c8c30c58",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2838,7 +2838,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-12-21T18:03:19+00:00"
|
||||
"time": "2024-12-27T09:25:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nette/schema",
|
||||
@ -4732,12 +4732,12 @@
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/contracts",
|
||||
"name": "symfony/contracts"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-main": "3.5-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -4955,12 +4955,12 @@
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/contracts",
|
||||
"name": "symfony/contracts"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-main": "3.5-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -6233,12 +6233,12 @@
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/contracts",
|
||||
"name": "symfony/contracts"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-main": "3.5-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -6493,12 +6493,12 @@
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/contracts",
|
||||
"name": "symfony/contracts"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-main": "3.5-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => 'email',
|
||||
'username' => 'username',
|
||||
|
||||
'email' => 'email',
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
||||
// Features::profilePhotos(),
|
||||
// Features::api(),
|
||||
// Features::teams(['invitations' => true]),
|
||||
Features::accountDeletion(),
|
||||
// Features::accountDeletion(),
|
||||
],
|
||||
|
||||
/*
|
||||
|
@ -15,18 +15,21 @@ public function up(): void
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->string('username')->unique();
|
||||
$table->string('email')->nullable()->index();
|
||||
$table->string('phone')->nullable()->index();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->foreignId('current_team_id')->nullable();
|
||||
$table->string('profile_photo_path', 2048)->nullable();
|
||||
$table->unsignedTinyInteger('role')->default(0);
|
||||
//$table->foreignId('current_team_id')->nullable();
|
||||
$table->string('profile_photo_path')->nullable();
|
||||
$table->foreignIdFor(Site::class)->nullable()->index();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('username')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
@ -23,20 +23,22 @@ public function up(): void
|
||||
$table->string('institution_name');
|
||||
$table->string('accession_number')->nullable();
|
||||
$table->string('study_description')->nullable();
|
||||
$table->text('history')->nullable();
|
||||
$table->dateTime('study_date')->index();
|
||||
$table->dateTime('upload_date')->index();
|
||||
$table->dateTime('receive_date')->index();
|
||||
$table->dateTime('report_date')->nullable();
|
||||
$table->foreignIdFor(Site::class)->constrained()->onDelete('cascade');
|
||||
$table->unsignedTinyInteger('report_status')->default(0);
|
||||
$table->string('study_modality', 4);
|
||||
$table->foreignIdFor(User::class, 'assigned_physician_id')->nullable()->constrained()->onDelete('set null');
|
||||
$table->foreignIdFor(User::class, 'interpreting_physician_id')->nullable()->constrained()->onDelete('set null');
|
||||
$table->foreignIdFor(User::class, 'referring_physician_id')->nullable()->constrained()->onDelete('set null');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['site_id', 'upload_date']);
|
||||
$table->index(['referring_physician_id', 'receive_date']);
|
||||
$table->index(['site_id', 'receive_date']);
|
||||
$table->index(['site_id', 'accession_number']);
|
||||
$table->index(['site_id', 'report_status', 'priority', 'upload_date']);
|
||||
$table->index(['site_id', 'report_status', 'priority', 'receive_date']);
|
||||
$table->index(['assigned_physician_id', 'report_status', 'priority', 'receive_date']);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ public function up(): void
|
||||
$table->foreignIdFor(Study::class)->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(User::class)->nullable()->constrained()->onDelete('cascade');
|
||||
$table->string('title')->nullable();
|
||||
$table->text('note');
|
||||
$table->longText('content');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['study_id', 'created_at']);
|
||||
|
@ -16,8 +16,8 @@
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<x-label for="email" value="{{ __('Email') }}" />
|
||||
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus autocomplete="username" />
|
||||
<x-label for="username" value="{{ __('Username') }}" />
|
||||
<x-input id="username" class="block mt-1 w-full" name="username" :value="old('username')" required autofocus autocomplete="username" />
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
|
@ -14,9 +14,14 @@
|
||||
<x-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus autocomplete="name" />
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<x-label for="username" value="{{ __('Username') }}" />
|
||||
<x-input id="username" class="block mt-1 w-full" name="username" :value="old('username')" required autofocus autocomplete="username" />
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<x-label for="email" value="{{ __('Email') }}" />
|
||||
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autocomplete="username" />
|
||||
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autocomplete="email" />
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
|
Loading…
Reference in New Issue
Block a user