From 7dca5d1e6cc7d9c73ac760d0e8ff5888969a976d Mon Sep 17 00:00:00 2001 From: Adrian Hopek Date: Fri, 14 Jan 2022 15:09:08 +0100 Subject: [PATCH] #4 - wip --- .env.example | 2 + app/Console/Commands/CreateUserCommand.php | 24 ++ app/Enums/FormOfEmployment.php | 18 + app/Http/Controllers/UserController.php | 11 +- app/Http/Resources/UserResource.php | 4 +- app/Models/User.php | 27 ++ app/Observers/UserObserver.php | 52 +++ app/Providers/AppServiceProvider.php | 6 + composer.json | 3 +- composer.lock | 372 +++++++++++++++++- config/colors.php | 7 + config/filesystems.php | 1 + database/factories/UserFactory.php | 5 +- .../2014_10_12_000000_create_users_table.php | 3 + database/seeders/DatabaseSeeder.php | 3 +- package-lock.json | 1 + package.json | 1 + public/avatars | 1 + resources/js/Pages/Users/Index.vue | 321 ++++++++------- resources/js/Shared/MainMenu.vue | 2 +- resources/lang/en/pagination.php | 4 +- resources/lang/pl.json | 6 +- resources/lang/pl/auth.php | 9 + resources/lang/pl/pagination.php | 8 + resources/lang/pl/passwords.php | 11 + resources/lang/pl/validation.php | 117 ++++++ routes/web.php | 2 +- 27 files changed, 871 insertions(+), 150 deletions(-) create mode 100644 app/Console/Commands/CreateUserCommand.php create mode 100644 app/Enums/FormOfEmployment.php create mode 100644 app/Observers/UserObserver.php create mode 100644 config/colors.php create mode 120000 public/avatars create mode 100644 resources/lang/pl/auth.php create mode 100644 resources/lang/pl/pagination.php create mode 100644 resources/lang/pl/passwords.php create mode 100644 resources/lang/pl/validation.php diff --git a/.env.example b/.env.example index 30e2550..cee7c90 100644 --- a/.env.example +++ b/.env.example @@ -48,3 +48,5 @@ DOCKER_INSTALL_XDEBUG=false GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= GOOGLE_REDIRECT= + +USER_EMAIL= diff --git a/app/Console/Commands/CreateUserCommand.php b/app/Console/Commands/CreateUserCommand.php new file mode 100644 index 0000000..062e3ea --- /dev/null +++ b/app/Console/Commands/CreateUserCommand.php @@ -0,0 +1,24 @@ +argument("email"); + + User::factory(["email" => $email])->create(); + + $this->info("User has been created"); + } +} diff --git a/app/Enums/FormOfEmployment.php b/app/Enums/FormOfEmployment.php new file mode 100644 index 0000000..1b0d9a3 --- /dev/null +++ b/app/Enums/FormOfEmployment.php @@ -0,0 +1,18 @@ +value); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 1a03c14..113631f 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -4,16 +4,23 @@ declare(strict_types=1); namespace Toby\Http\Controllers; +use Illuminate\Http\Request; use Inertia\Response; use Toby\Http\Resources\UserResource; use Toby\Models\User; class UserController extends Controller { - public function index(): Response + public function index(Request $request): Response { + $users = User::query() + ->search($request->query("search")) + ->paginate() + ->withQueryString(); + return inertia("Users/Index", [ - "users" => UserResource::collection(User::all()), + "users" => UserResource::collection($users), + "filters" => $request->only("search"), ]); } } diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php index b3e03f0..e2b166a 100644 --- a/app/Http/Resources/UserResource.php +++ b/app/Http/Resources/UserResource.php @@ -15,7 +15,9 @@ class UserResource extends JsonResource "name" => $this->name, "email" => $this->email, "role" => "Human Resources Manager", - "avatar" => "https://images.unsplash.com/photo-1550525811-e5869dd03032?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80", + "avatar" => asset($this->avatar), + "employmentForm" => $this->employment_form->label(), + "employmentStartDate" => $this->employment_start_date->translatedFormat("j F Y"), ]; } } diff --git a/app/Models/User.php b/app/Models/User.php index 660b8f7..f9f5d5f 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -4,26 +4,53 @@ declare(strict_types=1); namespace Toby\Models; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use Illuminate\Support\Carbon; +use Toby\Enums\FormOfEmployment; /** * @property int $id * @property string $name * @property string $email + * @property string $avatar + * @property FormOfEmployment $employment_form + * @property Carbon $empoyment_start_date */ class User extends Authenticatable { use HasFactory; use Notifiable; + protected $perPage = 10; + protected $fillable = [ "name", "email", + "avatar", + "employment_form", + "employment_start_date", + ]; + + protected $casts = [ + "employment_form" => FormOfEmployment::class, + "employment_start_date" => "datetime", ]; protected $hidden = [ "remember_token", ]; + + public function scopeSearch(Builder $query, ?string $text): Builder + { + if ($text == null) { + return $query; + } + + return $query + ->where("name", "LIKE", "%{$text}%") + ->orWhere("email", "LIKE", "%{$text}%"); + } } diff --git a/app/Observers/UserObserver.php b/app/Observers/UserObserver.php new file mode 100644 index 0000000..b81ab0f --- /dev/null +++ b/app/Observers/UserObserver.php @@ -0,0 +1,52 @@ +avatar = $this->generateAvatar($user); + + $user->save(); + } + + public function updating(User $user): void + { + if ($user->isDirty("name")) { + $user->avatar = $this->generateAvatar($user); + } + } + + public function deleted(User $user): void + { + Storage::delete($user->avatar); + } + + protected function generateAvatar(User $user): string + { + $path = "avatars/{$user->id}.svg"; + + Storage::put($path, $this->generator->rounded()->background($this->getRandomColor())->generateSvg($user->name)); + + return $path; + } + + protected function getRandomColor(): string + { + $colors = config("colors"); + + return Arr::random($colors); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 08b69d4..f8c204d 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -5,7 +5,13 @@ declare(strict_types=1); namespace Toby\Providers; use Illuminate\Support\ServiceProvider; +use Toby\Models\User; +use Toby\Observers\UserObserver; class AppServiceProvider extends ServiceProvider { + public function boot(): void + { + User::observe(UserObserver::class); + } } diff --git a/composer.json b/composer.json index 83abbee..6e34c8a 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,8 @@ "laravel/framework": "^8.75", "laravel/socialite": "^5.2", "laravel/telescope": "^4.6", - "laravel/tinker": "^2.5" + "laravel/tinker": "^2.5", + "lasserafn/php-initial-avatar-generator": "^4.2" }, "require-dev": { "blumilksoftware/codestyle": "^0.9.0", diff --git a/composer.lock b/composer.lock index e9f029f..da87b0f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6c0c7586f9003a71d9299165b3d5030d", + "content-hash": "ad1daca5c42430dda8fb886074c9fc2a", "packages": [ { "name": "asm89/stack-cors", @@ -1028,6 +1028,90 @@ ], "time": "2022-01-12T16:18:26+00:00" }, + { + "name": "intervention/image", + "version": "2.7.1", + "source": { + "type": "git", + "url": "https://github.com/Intervention/image.git", + "reference": "744ebba495319501b873a4e48787759c72e3fb8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/image/zipball/744ebba495319501b873a4e48787759c72e3fb8c", + "reference": "744ebba495319501b873a4e48787759c72e3fb8c", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "guzzlehttp/psr7": "~1.1 || ^2.0", + "php": ">=5.4.0" + }, + "require-dev": { + "mockery/mockery": "~0.9.2", + "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15" + }, + "suggest": { + "ext-gd": "to use GD library based image processing.", + "ext-imagick": "to use Imagick based image processing.", + "intervention/imagecache": "Caching extension for the Intervention Image library" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + }, + "laravel": { + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": { + "Image": "Intervention\\Image\\Facades\\Image" + } + } + }, + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@olivervogel.com", + "homepage": "http://olivervogel.com/" + } + ], + "description": "Image handling and manipulation library with support for Laravel integration", + "homepage": "http://image.intervention.io/", + "keywords": [ + "gd", + "image", + "imagick", + "laravel", + "thumbnail", + "watermark" + ], + "support": { + "issues": "https://github.com/Intervention/image/issues", + "source": "https://github.com/Intervention/image/tree/2.7.1" + }, + "funding": [ + { + "url": "https://www.paypal.me/interventionphp", + "type": "custom" + }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "time": "2021-12-16T16:49:26+00:00" + }, { "name": "laravel/framework", "version": "v8.79.0", @@ -1464,6 +1548,169 @@ }, "time": "2022-01-10T08:52:49+00:00" }, + { + "name": "lasserafn/php-initial-avatar-generator", + "version": "4.2.1", + "source": { + "type": "git", + "url": "https://github.com/LasseRafn/php-initial-avatar-generator.git", + "reference": "49d0b10cc8819af831e0f6fb1056a7d5ed9512d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/LasseRafn/php-initial-avatar-generator/zipball/49d0b10cc8819af831e0f6fb1056a7d5ed9512d0", + "reference": "49d0b10cc8819af831e0f6fb1056a7d5ed9512d0", + "shasum": "" + }, + "require": { + "ext-json": "*", + "intervention/image": "^2.3", + "lasserafn/php-initials": "^3.0", + "lasserafn/php-string-script-language": "^0.3.0", + "meyfa/php-svg": "^0.9.0", + "overtrue/pinyin": "^4.0", + "php": "^7.0|^7.1|^7.2|^7.3|^7.4|^8.0" + }, + "require-dev": { + "doctrine/instantiator": "1.0.*", + "phpunit/phpunit": "^6.5", + "satooshi/php-coveralls": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "LasseRafn\\InitialAvatarGenerator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lasse Rafn", + "email": "lasserafn@gmail.com" + } + ], + "description": "A package to generate avatars with initials for PHP", + "keywords": [ + "Initials", + "avatar", + "image", + "svg" + ], + "support": { + "issues": "https://github.com/LasseRafn/php-initial-avatar-generator/issues", + "source": "https://github.com/LasseRafn/php-initial-avatar-generator/tree/4.2.1" + }, + "funding": [ + { + "url": "https://opencollective.com/ui-avatars", + "type": "open_collective" + } + ], + "time": "2020-12-24T13:12:12+00:00" + }, + { + "name": "lasserafn/php-initials", + "version": "3.1", + "source": { + "type": "git", + "url": "https://github.com/LasseRafn/php-initials.git", + "reference": "d287e1542687390eb68de779949bc0adc49e2d52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/LasseRafn/php-initials/zipball/d287e1542687390eb68de779949bc0adc49e2d52", + "reference": "d287e1542687390eb68de779949bc0adc49e2d52", + "shasum": "" + }, + "require": { + "php": "^5.6|^7.0|^7.1|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "satooshi/php-coveralls": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "LasseRafn\\Initials\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lasse Rafn", + "email": "lasserafn@gmail.com" + } + ], + "description": "A package to generate initials in PHP", + "keywords": [ + "Initials", + "php" + ], + "support": { + "issues": "https://github.com/LasseRafn/php-initials/issues", + "source": "https://github.com/LasseRafn/php-initials/tree/3.1" + }, + "time": "2020-12-24T12:25:51+00:00" + }, + { + "name": "lasserafn/php-string-script-language", + "version": "0.3", + "source": { + "type": "git", + "url": "https://github.com/LasseRafn/php-string-script-language.git", + "reference": "49a09d4a5e38c1e59a2656ac05b601d615c7cddb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/LasseRafn/php-string-script-language/zipball/49a09d4a5e38c1e59a2656ac05b601d615c7cddb", + "reference": "49a09d4a5e38c1e59a2656ac05b601d615c7cddb", + "shasum": "" + }, + "require": { + "php": "^5.6|^7.0|^7.1|^8.0" + }, + "require-dev": { + "doctrine/instantiator": "1.0.5", + "phpunit/phpunit": "^5.6", + "phpunit/phpunit-mock-objects": "3.2.4", + "satooshi/php-coveralls": "^1.0", + "sebastian/exporter": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "LasseRafn\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lasse Rafn", + "email": "lasserafn@gmail.com" + } + ], + "description": "Detect language/encoding of a string in PHP", + "keywords": [ + "language", + "php", + "string" + ], + "support": { + "issues": "https://github.com/LasseRafn/php-string-script-language/issues", + "source": "https://github.com/LasseRafn/php-string-script-language/tree/0.3" + }, + "time": "2020-12-24T12:43:59+00:00" + }, { "name": "league/commonmark", "version": "2.1.1", @@ -1875,6 +2122,56 @@ }, "time": "2021-08-15T23:05:49+00:00" }, + { + "name": "meyfa/php-svg", + "version": "v0.9.1", + "source": { + "type": "git", + "url": "https://github.com/meyfa/php-svg.git", + "reference": "34401edef1f724898f468f71b85505fbcc8351bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/meyfa/php-svg/zipball/34401edef1f724898f468f71b85505fbcc8351bb", + "reference": "34401edef1f724898f468f71b85505fbcc8351bb", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "ext-simplexml": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "meyfa/phpunit-assert-gd": "^1.1", + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "SVG\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabian Meyer", + "homepage": "http://meyfa.net" + } + ], + "description": "Read, edit, write, and render SVG files with PHP", + "homepage": "https://github.com/meyfa/php-svg", + "keywords": [ + "svg" + ], + "support": { + "issues": "https://github.com/meyfa/php-svg/issues", + "source": "https://github.com/meyfa/php-svg/tree/v0.9.1" + }, + "time": "2019-07-30T18:41:25+00:00" + }, { "name": "monolog/monolog", "version": "2.3.5", @@ -2338,6 +2635,79 @@ }, "time": "2021-04-09T13:42:10+00:00" }, + { + "name": "overtrue/pinyin", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/overtrue/pinyin.git", + "reference": "04bdb4d33d50e8fb1aa5a824064c5151c4b15dc2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/overtrue/pinyin/zipball/04bdb4d33d50e8fb1aa5a824064c5151c4b15dc2", + "reference": "04bdb4d33d50e8fb1aa5a824064c5151c4b15dc2", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "brainmaestro/composer-git-hooks": "^2.7", + "friendsofphp/php-cs-fixer": "^2.16", + "phpunit/phpunit": "~8.0" + }, + "type": "library", + "extra": { + "hooks": { + "pre-commit": [ + "composer test", + "composer fix-style" + ], + "pre-push": [ + "composer test", + "composer check-style" + ] + } + }, + "autoload": { + "psr-4": { + "Overtrue\\Pinyin\\": "src/" + }, + "files": [ + "src/const.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "overtrue", + "email": "anzhengchao@gmail.com", + "homepage": "http://github.com/overtrue" + } + ], + "description": "Chinese to pinyin translator.", + "homepage": "https://github.com/overtrue/pinyin", + "keywords": [ + "Chinese", + "Pinyin", + "cn2pinyin" + ], + "support": { + "issues": "https://github.com/overtrue/pinyin/issues", + "source": "https://github.com/overtrue/pinyin/tree/4.0.8" + }, + "funding": [ + { + "url": "https://www.patreon.com/overtrue", + "type": "patreon" + } + ], + "time": "2021-07-19T03:43:32+00:00" + }, { "name": "phpoption/phpoption", "version": "1.8.1", diff --git a/config/colors.php b/config/colors.php new file mode 100644 index 0000000..cc26b55 --- /dev/null +++ b/config/colors.php @@ -0,0 +1,7 @@ + [ public_path("storage") => storage_path("app/public"), + public_path("avatars") => storage_path("app/avatars"), ], ]; diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 4ddc304..e3f0a21 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -6,14 +6,17 @@ namespace Database\Factories; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; +use Toby\Enums\FormOfEmployment; class UserFactory extends Factory { public function definition(): array { return [ - "name" => $this->faker->name(), + "name" => "{$this->faker->firstName} {$this->faker->lastName}", "email" => $this->faker->unique()->safeEmail(), + "employment_form" => $this->faker->randomElement(FormOfEmployment::cases()), + "employment_start_date" => $this->faker->dateTimeBetween("2020-10-27"), "remember_token" => Str::random(10), ]; } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index d1943d9..c057ac9 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -13,6 +13,9 @@ return new class() extends Migration { $table->id(); $table->string("name"); $table->string("email")->unique(); + $table->string("avatar")->nullable(); + $table->string("employment_form"); + $table->dateTime("employment_start_date"); $table->rememberToken(); $table->timestamps(); }); diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 1649f4a..ed034d2 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -11,6 +11,7 @@ class DatabaseSeeder extends Seeder { public function run(): void { - User::factory(10)->create(); + User::factory(35)->create(); + User::factory(["email" => env("USER_EMAIL")])->create(); } } diff --git a/package-lock.json b/package-lock.json index f5d5036..e869d61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@vue/compiler-sfc": "^3.2.26", "autoprefixer": "^10.4.2", "laravel-mix": "^6.0.6", + "lodash": "^4.17.21", "postcss": "^8.4.5", "tailwindcss": "^3.0.13", "vue": "^3.2.26", diff --git a/package.json b/package.json index 4ac8b9c..b858b8c 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@vue/compiler-sfc": "^3.2.26", "autoprefixer": "^10.4.2", "laravel-mix": "^6.0.6", + "lodash": "^4.17.21", "postcss": "^8.4.5", "tailwindcss": "^3.0.13", "vue": "^3.2.26", diff --git a/public/avatars b/public/avatars new file mode 120000 index 0000000..c6a773f --- /dev/null +++ b/public/avatars @@ -0,0 +1 @@ +/application/storage/app/avatars \ No newline at end of file diff --git a/resources/js/Pages/Users/Index.vue b/resources/js/Pages/Users/Index.vue index aca6f67..6a52049 100644 --- a/resources/js/Pages/Users/Index.vue +++ b/resources/js/Pages/Users/Index.vue @@ -1,5 +1,6 @@ diff --git a/resources/js/Shared/MainMenu.vue b/resources/js/Shared/MainMenu.vue index b0d91de..8cc856d 100644 --- a/resources/js/Shared/MainMenu.vue +++ b/resources/js/Shared/MainMenu.vue @@ -265,7 +265,7 @@ export default { setup() { const user = computed(() => usePage().props.value.auth.user); const navigation = [ - {name: 'Dashboard', href: '/', current: true}, + {name: 'Strona główna', href: '/', current: true}, {name: 'Użytkownicy', href: '/users', current: false}, {name: 'Resources', href: '#', current: false}, {name: 'Company Directory', href: '#', current: false}, diff --git a/resources/lang/en/pagination.php b/resources/lang/en/pagination.php index d654f2e..5f11429 100644 --- a/resources/lang/en/pagination.php +++ b/resources/lang/en/pagination.php @@ -3,6 +3,6 @@ declare(strict_types=1); return [ - "previous" => "« Previous", - "next" => "Next »", + "previous" => "Previous", + "next" => "Next", ]; diff --git a/resources/lang/pl.json b/resources/lang/pl.json index 41d1f41..d99f817 100644 --- a/resources/lang/pl.json +++ b/resources/lang/pl.json @@ -1,3 +1,7 @@ { - "User does not exist.": "Użytkownik nie istnieje." + "User does not exist.": "Użytkownik nie istnieje.", + "employment_contract": "Umowa o pracę", + "commission_contract": "Umowa zlecenie", + "b2b_contract": "Kontrakt B2B", + "board_member_contract": "Członek zarządu" } \ No newline at end of file diff --git a/resources/lang/pl/auth.php b/resources/lang/pl/auth.php new file mode 100644 index 0000000..573bf69 --- /dev/null +++ b/resources/lang/pl/auth.php @@ -0,0 +1,9 @@ + "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.", +]; \ No newline at end of file diff --git a/resources/lang/pl/pagination.php b/resources/lang/pl/pagination.php new file mode 100644 index 0000000..3d3e2db --- /dev/null +++ b/resources/lang/pl/pagination.php @@ -0,0 +1,8 @@ + "Następna", + "previous" => "Poprzednia", +]; \ No newline at end of file diff --git a/resources/lang/pl/passwords.php b/resources/lang/pl/passwords.php new file mode 100644 index 0000000..01396c9 --- /dev/null +++ b/resources/lang/pl/passwords.php @@ -0,0 +1,11 @@ + "Hasło zostało zresetowane!", + "sent" => "Przypomnienie hasła zostało wysłane!", + "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.", +]; \ No newline at end of file diff --git a/resources/lang/pl/validation.php b/resources/lang/pl/validation.php new file mode 100644 index 0000000..07f05f1 --- /dev/null +++ b/resources/lang/pl/validation.php @@ -0,0 +1,117 @@ + "Pole :attribute musi zostać zaakceptowane.", + "active_url" => "Pole :attribute jest nieprawidłowym adresem URL.", + "after" => "Pole :attribute musi być datą późniejszą od :date.", + "after_or_equal" => "Pole :attribute musi być datą nie wcześniejszą niż :date.", + "alpha" => "Pole :attribute może zawierać jedynie litery.", + "alpha_dash" => "Pole :attribute może zawierać jedynie litery, cyfry i myślniki.", + "alpha_num" => "Pole :attribute może zawierać jedynie litery i cyfry.", + "array" => "Pole :attribute musi być tablicą.", + "attached" => "Ten :attribute jest już dołączony.", + "before" => "Pole :attribute musi być datą wcześniejszą od :date.", + "before_or_equal" => "Pole :attribute musi być datą nie późniejszą niż :date.", + "between" => [ + "array" => "Pole :attribute musi składać się z :min - :max elementów.", + "file" => "Pole :attribute musi zawierać się w granicach :min - :max kilobajtów.", + "numeric" => "Pole :attribute musi zawierać się w granicach :min - :max.", + "string" => "Pole :attribute musi zawierać się w granicach :min - :max znaków.", + ], + "boolean" => "Pole :attribute musi mieć wartość logiczną prawda albo fałsz.", + "confirmed" => "Potwierdzenie pola :attribute nie zgadza się.", + "current_password" => "Hasło jest nieprawidłowe.", + "date" => "Pole :attribute nie jest prawidłową datą.", + "date_equals" => "Pole :attribute musi być datą równą :date.", + "date_format" => "Pole :attribute nie jest w formacie :format.", + "different" => "Pole :attribute oraz :other muszą się różnić.", + "digits" => "Pole :attribute musi składać się z :digits cyfr.", + "digits_between" => "Pole :attribute musi mieć od :min do :max cyfr.", + "dimensions" => "Pole :attribute ma niepoprawne wymiary.", + "distinct" => "Pole :attribute ma zduplikowane wartości.", + "email" => "Pole :attribute nie jest poprawnym adresem e-mail.", + "ends_with" => "Pole :attribute musi kończyć się jedną z następujących wartości: :values.", + "exists" => "Zaznaczone pole :attribute jest nieprawidłowe.", + "file" => "Pole :attribute musi być plikiem.", + "filled" => "Pole :attribute nie może być puste.", + "gt" => [ + "array" => "Pole :attribute musi mieć więcej niż :value elementów.", + "file" => "Pole :attribute musi być większe niż :value kilobajtów.", + "numeric" => "Pole :attribute musi być większe niż :value.", + "string" => "Pole :attribute musi być dłuższe niż :value znaków.", + ], + "gte" => [ + "array" => "Pole :attribute musi mieć :value lub więcej elementów.", + "file" => "Pole :attribute musi być większe lub równe :value kilobajtów.", + "numeric" => "Pole :attribute musi być większe lub równe :value.", + "string" => "Pole :attribute musi być dłuższe lub równe :value znaków.", + ], + "image" => "Pole :attribute musi być obrazkiem.", + "in" => "Zaznaczony element :attribute jest nieprawidłowy.", + "in_array" => "Pole :attribute nie znajduje się w :other.", + "integer" => "Pole :attribute musi być liczbą całkowitą.", + "ip" => "Pole :attribute musi być prawidłowym adresem IP.", + "ipv4" => "Pole :attribute musi być prawidłowym adresem IPv4.", + "ipv6" => "Pole :attribute musi być prawidłowym adresem IPv6.", + "json" => "Pole :attribute musi być poprawnym ciągiem znaków JSON.", + "lt" => [ + "array" => "Pole :attribute musi mieć mniej niż :value elementów.", + "file" => "Pole :attribute musi być mniejsze niż :value kilobajtów.", + "numeric" => "Pole :attribute musi być mniejsze niż :value.", + "string" => "Pole :attribute musi być krótsze niż :value znaków.", + ], + "lte" => [ + "array" => "Pole :attribute musi mieć :value lub mniej elementów.", + "file" => "Pole :attribute musi być mniejsze lub równe :value kilobajtów.", + "numeric" => "Pole :attribute musi być mniejsze lub równe :value.", + "string" => "Pole :attribute musi być krótsze lub równe :value znaków.", + ], + "max" => [ + "array" => "Pole :attribute nie może mieć więcej niż :max elementów.", + "file" => "Pole :attribute nie może być większe niż :max kilobajtów.", + "numeric" => "Pole :attribute nie może być większe niż :max.", + "string" => "Pole :attribute nie może być dłuższe niż :max znaków.", + ], + "mimes" => "Pole :attribute musi być plikiem typu :values.", + "mimetypes" => "Pole :attribute musi być plikiem typu :values.", + "min" => [ + "array" => "Pole :attribute musi mieć przynajmniej :min elementów.", + "file" => "Pole :attribute musi mieć przynajmniej :min kilobajtów.", + "numeric" => "Pole :attribute musi być nie mniejsze od :min.", + "string" => "Pole :attribute musi mieć przynajmniej :min znaków.", + ], + "multiple_of" => "Pole :attribute musi być wielokrotnością wartości :value", + "not_in" => "Zaznaczony :attribute jest nieprawidłowy.", + "not_regex" => "Format pola :attribute jest nieprawidłowy.", + "numeric" => "Pole :attribute musi być liczbą.", + "password" => "Hasło jest nieprawidłowe.", + "present" => "Pole :attribute musi być obecne.", + "prohibited" => "Pole :attribute jest zabronione.", + "prohibited_if" => "Pole :attribute jest zabronione, gdy :other to :value.", + "prohibited_unless" => "Pole :attribute jest zabronione, chyba że :other jest w :values.", + "regex" => "Format pola :attribute jest nieprawidłowy.", + "relatable" => "Ten :attribute może nie być powiązany z tym zasobem.", + "required" => "Pole :attribute jest wymagane.", + "required_if" => "Pole :attribute jest wymagane gdy :other ma wartość :value.", + "required_unless" => "Pole :attribute jest wymagane jeżeli :other nie znajduje się w :values.", + "required_with" => "Pole :attribute jest wymagane gdy :values jest obecny.", + "required_with_all" => "Pole :attribute jest wymagane gdy wszystkie :values są obecne.", + "required_without" => "Pole :attribute jest wymagane gdy :values nie jest obecny.", + "required_without_all" => "Pole :attribute jest wymagane gdy żadne z :values nie są obecne.", + "same" => "Pole :attribute i :other muszą być takie same.", + "size" => [ + "array" => "Pole :attribute musi zawierać :size elementów.", + "file" => "Pole :attribute musi mieć :size kilobajtów.", + "numeric" => "Pole :attribute musi mieć :size.", + "string" => "Pole :attribute musi mieć :size znaków.", + ], + "starts_with" => "Pole :attribute musi zaczynać się jedną z następujących wartości: :values.", + "string" => "Pole :attribute musi być ciągiem znaków.", + "timezone" => "Pole :attribute musi być prawidłową strefą czasową.", + "unique" => "Taki :attribute już występuje.", + "uploaded" => "Nie udało się wgrać pliku :attribute.", + "url" => "Format pola :attribute jest nieprawidłowy.", + "uuid" => "Pole :attribute musi być poprawnym identyfikatorem UUID.", +]; \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 5b25054..98adb33 100644 --- a/routes/web.php +++ b/routes/web.php @@ -21,4 +21,4 @@ Route::middleware("guest")->group(function (): void { ->name("login.google.start"); Route::get("login/google/end", [GoogleController::class, "callback"]) ->name("login.google.end"); -}); +}); \ No newline at end of file