This commit is contained in:
EwelinaLasowy 2022-01-17 10:37:41 +01:00
parent 7dca5d1e6c
commit fc4669568c
14 changed files with 41 additions and 23 deletions

View File

@ -11,14 +11,16 @@ class CreateUserCommand extends Command
{
protected $signature = "user:create
{email : an email for the user}";
protected $description = "Creates user";
protected $description = "Creates a user";
public function handle(): void
{
$email = $this->argument("email");
User::factory(["email" => $email])->create();
User::factory([
"email" => $email,
])->create();
$this->info("User has been created");
$this->info("The user has been created");
}
}

View File

@ -15,4 +15,4 @@ enum FormOfEmployment: string
{
return __($this->value);
}
}
}

View File

@ -17,7 +17,7 @@ use Toby\Enums\FormOfEmployment;
* @property string $email
* @property string $avatar
* @property FormOfEmployment $employment_form
* @property Carbon $empoyment_start_date
* @property Carbon $employment_start_date
*/
class User extends Authenticatable
{
@ -45,7 +45,7 @@ class User extends Authenticatable
public function scopeSearch(Builder $query, ?string $text): Builder
{
if ($text == null) {
if ($text === null) {
return $query;
}

View File

@ -6,13 +6,14 @@ namespace Toby\Observers;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Storage;
use Toby\Models\User;
use LasseRafn\InitialAvatarGenerator\InitialAvatar;
use Toby\Models\User;
class UserObserver
{
public function __construct(protected InitialAvatar $generator)
{
public function __construct(
protected InitialAvatar $generator,
) {
}
public function created(User $user): void
@ -38,7 +39,7 @@ class UserObserver
{
$path = "avatars/{$user->id}.svg";
Storage::put($path, $this->generator->rounded()->background($this->getRandomColor())->generateSvg($user->name));
Storage::put($path, $this->generator->rounded()->background($this->getRandomColor())->color("#F4F8FD")->smooth()->generateSvg($user->name));
return $path;
}

View File

@ -3,5 +3,19 @@
declare(strict_types=1);
return [
"#F0E9E9",
];
"#475569",
"#EA580C",
"#EAB308",
"#CA8A04",
"#84CC16",
"#4D7C0F",
"#10B981",
"#06B6D4",
"#4338CA",
"#A855F7",
"#86198F",
"#FB7185",
"#EC4899",
"#9D174D",
"#F43F5E",
];

View File

@ -12,6 +12,8 @@ class DatabaseSeeder extends Seeder
public function run(): void
{
User::factory(35)->create();
User::factory(["email" => env("USER_EMAIL")])->create();
User::factory([
"email" => env("USER_EMAIL"),
])->create();
}
}

View File

@ -61,12 +61,12 @@
<tr
v-for="user in users.data"
:key="user.id"
class="hover:bg-white"
class="hover:bg-blumilk-25"
>
<td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">
<div class="flex">
<span
class="inline-flex items-center justify-center h-10 w-10 rounded-full bg-blumilk-500"
class="inline-flex items-center justify-center h-10 w-10 rounded-full"
>
<img
class="h-10 w-10 rounded-full"

View File

@ -37,7 +37,7 @@
>
<div>
<MenuButton
class="bg-white rounded-full flex text-sm ring-2 ring-white ring-opacity-20 focus:outline-none focus:ring-opacity-100"
class="rounded-full flex text-sm ring-2 ring-white ring-opacity-20 focus:outline-none focus:ring-opacity-100"
>
<span class="sr-only">Open user menu</span>
<img

View File

@ -4,4 +4,4 @@
"commission_contract": "Umowa zlecenie",
"b2b_contract": "Kontrakt B2B",
"board_member_contract": "Członek zarządu"
}
}

View File

@ -6,4 +6,4 @@ return [
"failed" => "Błędny login lub hasło.",
"password" => "Podane hasło jest nieprawidłowe.",
"throttle" => "Za dużo nieudanych prób logowania. Proszę spróbować za :seconds sekund.",
];
];

View File

@ -5,4 +5,4 @@ declare(strict_types=1);
return [
"next" => "Następna",
"previous" => "Poprzednia",
];
];

View File

@ -8,4 +8,4 @@ return [
"throttled" => "Proszę zaczekać zanim spróbujesz ponownie.",
"token" => "Token resetowania hasła jest nieprawidłowy.",
"user" => "Nie znaleziono użytkownika z takim adresem e-mail.",
];
];

View File

@ -114,4 +114,4 @@ return [
"uploaded" => "Nie udało się wgrać pliku :attribute.",
"url" => "Format pola :attribute jest nieprawidłowy.",
"uuid" => "Pole :attribute musi być poprawnym identyfikatorem UUID.",
];
];

View File

@ -12,7 +12,6 @@ Route::middleware("auth")->group(function (): void {
Route::post("/logout", LogoutController::class);
Route::resource("users", UserController::class);
});
Route::middleware("guest")->group(function (): void {
@ -21,4 +20,4 @@ Route::middleware("guest")->group(function (): void {
->name("login.google.start");
Route::get("login/google/end", [GoogleController::class, "callback"])
->name("login.google.end");
});
});