diff --git a/.env.example b/.env.example index d7235cd8..b8d27577 100644 --- a/.env.example +++ b/.env.example @@ -5,10 +5,6 @@ APP_KEY=base64:sCsJw8z+d/4ymp0OvzSip2h4Vp2hZZhpV2uOxgTqP94= APP_DEBUG=true APP_URL=http://interns2024b.blumilk.localhost -APP_LOCALE=en -APP_FALLBACK_LOCALE=en -APP_FAKER_LOCALE=en_US - APP_MAINTENANCE_DRIVER=file APP_MAINTENANCE_STORE=database diff --git a/app/Http/Controllers/AuthenticateSessionController.php b/app/Http/Controllers/AuthenticateSessionController.php new file mode 100644 index 00000000..3f9795ea --- /dev/null +++ b/app/Http/Controllers/AuthenticateSessionController.php @@ -0,0 +1,41 @@ +only("email", "password"); + + if (auth()->attempt($credentials)) { + $request->session()->regenerate(); + + return Redirect::route("home")->with("success"); + } + + throw ValidationException::withMessages([ + "email" => "Wrong email or password", + ]); + } + + public function logout(): RedirectResponse + { + auth()->logout(); + + request()->session()->invalidate(); + request()->session()->regenerateToken(); + + return Redirect::route("home")->with("success"); + } +} diff --git a/app/Http/Controllers/ContestController.php b/app/Http/Controllers/ContestController.php new file mode 100644 index 00000000..50793353 --- /dev/null +++ b/app/Http/Controllers/ContestController.php @@ -0,0 +1,20 @@ +sortBy("name"); + + return Inertia::render("Home", ["schools" => SchoolResource::collection($schools)]); + } +} diff --git a/app/Http/Controllers/EmailVerifyController.php b/app/Http/Controllers/EmailVerifyController.php new file mode 100644 index 00000000..f954d147 --- /dev/null +++ b/app/Http/Controllers/EmailVerifyController.php @@ -0,0 +1,34 @@ +fulfill(); + + return Redirect::route("home"); + } + + public function create(): Response + { + return Inertia::render("Auth/Verify-Email"); + } + + public function send(Request $request): RedirectResponse + { + $request->user()->sendEmailVerificationNotification(); + + return back()->with("message", "Verification link sent!"); + } +} diff --git a/app/Http/Controllers/PasswordResetLinkController.php b/app/Http/Controllers/PasswordResetLinkController.php new file mode 100644 index 00000000..0bdffc80 --- /dev/null +++ b/app/Http/Controllers/PasswordResetLinkController.php @@ -0,0 +1,62 @@ + session()->get("status")]); + } + + public function store(ForgotPasswordRequest $request): RedirectResponse + { + $request->only("email"); + + $status = Password::sendResetLink( + $request->only("email"), + ); + + return $status === Password::RESET_LINK_SENT + ? back()->with(["status" => __($status)]) + : back()->with(["status" => __("passwords.sent")]); + } + + public function resetCreate(string $token): Response + { + return Inertia::render("Auth/ResetPassword", ["token" => $token]); + } + + public function resetStore(ResetPasswordRequest $request): RedirectResponse + { + $status = Password::reset( + $request->only("email", "password", "password_confirmation", "token"), + function (User $user, string $password): void { + $user->forceFill([ + "password" => Hash::make($password), + ])->setRememberToken(Str::random(60)); + + $user->save(); + + event(new PasswordReset($user)); + }, + ); + + return $status === Password::PASSWORD_RESET + ? redirect()->route("home")->with("status", __($status)) + : back()->withErrors(["email" => [__($status)]]); + } +} diff --git a/app/Http/Controllers/RegisterUserController.php b/app/Http/Controllers/RegisterUserController.php new file mode 100644 index 00000000..7c3dd6be --- /dev/null +++ b/app/Http/Controllers/RegisterUserController.php @@ -0,0 +1,31 @@ +where("email", $request->email)->exists(); + + if (!$userExists) { + $user = new User($request->validated()); + $user->password = Hash::make($request->password); + $user->save(); + event(new Registered($user)); + Auth::login($user); + } + + return Redirect::route("home"); + } +} diff --git a/app/Http/Requests/Auth/AuthenticateSessionRequest.php b/app/Http/Requests/Auth/AuthenticateSessionRequest.php new file mode 100644 index 00000000..caadae17 --- /dev/null +++ b/app/Http/Requests/Auth/AuthenticateSessionRequest.php @@ -0,0 +1,23 @@ + ["required", "email", "max:255"], + "password" => ["required", "string"], + ]; + } +} diff --git a/app/Http/Requests/Auth/ForgotPasswordRequest.php b/app/Http/Requests/Auth/ForgotPasswordRequest.php new file mode 100644 index 00000000..b86fa0bc --- /dev/null +++ b/app/Http/Requests/Auth/ForgotPasswordRequest.php @@ -0,0 +1,22 @@ + ["required", "string", "email", "max:255"], + ]; + } +} diff --git a/app/Http/Requests/Auth/RegisterUserRequest.php b/app/Http/Requests/Auth/RegisterUserRequest.php new file mode 100644 index 00000000..4495fc06 --- /dev/null +++ b/app/Http/Requests/Auth/RegisterUserRequest.php @@ -0,0 +1,26 @@ + ["required", "string", "email:rfc,dns", "max:255"], + "name" => ["required", "string", "max:255"], + "surname" => ["required", "string", "max:255"], + "password" => ["required", "string", "min:8"], + "school_id" => ["required", "integer", "exists:schools,id"], + ]; + } +} diff --git a/app/Http/Requests/Auth/ResetPasswordRequest.php b/app/Http/Requests/Auth/ResetPasswordRequest.php new file mode 100644 index 00000000..603d409a --- /dev/null +++ b/app/Http/Requests/Auth/ResetPasswordRequest.php @@ -0,0 +1,24 @@ + ["required"], + "email" => ["required", "email", "max:255"], + "password" => ["required", "min:8", "confirmed:password_confirmation"], + ]; + } +} diff --git a/app/Http/Resources/SchoolResource.php b/app/Http/Resources/SchoolResource.php new file mode 100644 index 00000000..d2b86956 --- /dev/null +++ b/app/Http/Resources/SchoolResource.php @@ -0,0 +1,22 @@ + + */ + public function toArray(Request $request): array + { + return [ + "id" => $this->id, + "name" => $this->name, + ]; + } +} diff --git a/app/Mail/RegistrationMail.php b/app/Mail/RegistrationMail.php new file mode 100644 index 00000000..9bde402f --- /dev/null +++ b/app/Mail/RegistrationMail.php @@ -0,0 +1,33 @@ +belongsTo(School::class); + } + protected function casts(): array { return [ diff --git a/config/app.php b/config/app.php index 1c531b92..03e49b77 100644 --- a/config/app.php +++ b/config/app.php @@ -8,8 +8,8 @@ "debug" => (bool)env("APP_DEBUG", false), "url" => env("APP_URL", "http://localhost"), "timezone" => env("APP_TIMEZONE", "UTC"), - "locale" => env("APP_LOCALE", "en"), - "fallback_locale" => env("APP_FALLBACK_LOCALE", "en"), + "locale" => env("APP_LOCALE", "pl"), + "fallback_locale" => env("APP_FALLBACK_LOCALE", "pl"), "faker_locale" => env("APP_FAKER_LOCALE", "en_US"), "cipher" => "AES-256-CBC", "key" => env("APP_KEY"), diff --git a/database/factories/SchoolFactory.php b/database/factories/SchoolFactory.php new file mode 100644 index 00000000..a4cf9f2e --- /dev/null +++ b/database/factories/SchoolFactory.php @@ -0,0 +1,38 @@ + + */ +class SchoolFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + "name" => fake()->name(), + "city" => fake()->name(), + "street" => fake()->name(), + "building_number" => fake()->name(), + "apartment_number" => fake()->name(), + "zip_code" => fake()->name(), + ]; + } + + public function withoutApartment(): static + { + return $this->state(fn(array $attributes): array => [ + "apartment_number" => null, + ]); + } +} diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 61c04883..c805c16a 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -4,8 +4,11 @@ namespace Database\Factories; +use App\Models\School; use App\Models\User; +use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; /** @@ -17,10 +20,12 @@ public function definition(): array { return [ "name" => fake()->name(), + "surname" => fake()->name(), "email" => fake()->unique()->safeEmail(), - "email_verified_at" => now(), - "password" => "$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi", + "email_verified_at" => Carbon::now(), + "password" => Hash::make("password"), "remember_token" => Str::random(10), + "school_id" => School::factory(), ]; } diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 7c9f45db..38b52a4a 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -10,8 +10,9 @@ public function up(): void { Schema::create("users", function (Blueprint $table): void { - $table->id(); + $table->bigIncrements("id")->unique(); $table->string("name"); + $table->string("surname"); $table->string("email")->unique(); $table->timestamp("email_verified_at")->nullable(); $table->string("password"); diff --git a/database/migrations/2024_08_08_113859_create_schools_table.php b/database/migrations/2024_08_08_113859_create_schools_table.php new file mode 100644 index 00000000..1178a14b --- /dev/null +++ b/database/migrations/2024_08_08_113859_create_schools_table.php @@ -0,0 +1,28 @@ +bigIncrements("id")->unique(); + $table->string("name"); + $table->string("city"); + $table->string("street"); + $table->string("building_number"); + $table->string("apartment_number")->nullable(); + $table->string("zip_code"); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists("schools"); + } +}; diff --git a/database/migrations/2024_08_08_123147_add_school_id_to_users_table.php b/database/migrations/2024_08_08_123147_add_school_id_to_users_table.php new file mode 100644 index 00000000..f3210daa --- /dev/null +++ b/database/migrations/2024_08_08_123147_add_school_id_to_users_table.php @@ -0,0 +1,24 @@ +bigInteger("school_id"); + $table->foreign("school_id")->references("id")->on("schools")->onDelete("cascade"); + }); + } + + public function down(): void + { + Schema::table("users", function (Blueprint $table): void { + $table->dropColumn("users"); + }); + } +}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 7100a3df..16466def 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -4,13 +4,19 @@ namespace Database\Seeders; +use App\Models\Answer; use App\Models\AnswerRecord; +use App\Models\Quiz; +use App\Models\User; use Illuminate\Database\Seeder; class DatabaseSeeder extends Seeder { public function run(): void { + User::factory()->create(); + Quiz::factory()->create(); + Answer::factory()->create(); AnswerRecord::factory()->create(); } } diff --git a/lang/en/auth.php b/lang/en/auth.php new file mode 100644 index 00000000..48da02fc --- /dev/null +++ b/lang/en/auth.php @@ -0,0 +1,9 @@ + "These credentials do not match our records.", + "password" => "The provided password is incorrect.", + "throttle" => "Too many login attempts. Please try again in :seconds seconds.", +]; diff --git a/lang/en/pagination.php b/lang/en/pagination.php new file mode 100644 index 00000000..d654f2e3 --- /dev/null +++ b/lang/en/pagination.php @@ -0,0 +1,8 @@ + "« Previous", + "next" => "Next »", +]; diff --git a/lang/en/passwords.php b/lang/en/passwords.php new file mode 100644 index 00000000..7d62b40f --- /dev/null +++ b/lang/en/passwords.php @@ -0,0 +1,11 @@ + "Your password has been reset.", + "sent" => "We have emailed your password reset link.", + "throttled" => "Please wait before retrying.", + "token" => "This password reset token is invalid.", + "user" => "We can't find a user with that email address.", +]; diff --git a/lang/en/validation.php b/lang/en/validation.php new file mode 100644 index 00000000..a9fb9422 --- /dev/null +++ b/lang/en/validation.php @@ -0,0 +1,159 @@ + "The :attribute field must be accepted.", + "accepted_if" => "The :attribute field must be accepted when :other is :value.", + "active_url" => "The :attribute field must be a valid URL.", + "after" => "The :attribute field must be a date after :date.", + "after_or_equal" => "The :attribute field must be a date after or equal to :date.", + "alpha" => "The :attribute field must only contain letters.", + "alpha_dash" => "The :attribute field must only contain letters, numbers, dashes, and underscores.", + "alpha_num" => "The :attribute field must only contain letters and numbers.", + "array" => "The :attribute field must be an array.", + "ascii" => "The :attribute field must only contain single-byte alphanumeric characters and symbols.", + "before" => "The :attribute field must be a date before :date.", + "before_or_equal" => "The :attribute field must be a date before or equal to :date.", + "between" => [ + "array" => "The :attribute field must have between :min and :max items.", + "file" => "The :attribute field must be between :min and :max kilobytes.", + "numeric" => "The :attribute field must be between :min and :max.", + "string" => "The :attribute field must be between :min and :max characters.", + ], + "boolean" => "The :attribute field must be true or false.", + "can" => "The :attribute field contains an unauthorized value.", + "confirmed" => "The :attribute field confirmation does not match.", + "contains" => "The :attribute field is missing a required value.", + "current_password" => "The password is incorrect.", + "date" => "The :attribute field must be a valid date.", + "date_equals" => "The :attribute field must be a date equal to :date.", + "date_format" => "The :attribute field must match the format :format.", + "decimal" => "The :attribute field must have :decimal decimal places.", + "declined" => "The :attribute field must be declined.", + "declined_if" => "The :attribute field must be declined when :other is :value.", + "different" => "The :attribute field and :other must be different.", + "digits" => "The :attribute field must be :digits digits.", + "digits_between" => "The :attribute field must be between :min and :max digits.", + "dimensions" => "The :attribute field has invalid image dimensions.", + "distinct" => "The :attribute field has a duplicate value.", + "doesnt_end_with" => "The :attribute field must not end with one of the following: :values.", + "doesnt_start_with" => "The :attribute field must not start with one of the following: :values.", + "email" => "The :attribute field must be a valid email address.", + "ends_with" => "The :attribute field must end with one of the following: :values.", + "enum" => "The selected :attribute is invalid.", + "exists" => "The selected :attribute is invalid.", + "extensions" => "The :attribute field must have one of the following extensions: :values.", + "file" => "The :attribute field must be a file.", + "filled" => "The :attribute field must have a value.", + "gt" => [ + "array" => "The :attribute field must have more than :value items.", + "file" => "The :attribute field must be greater than :value kilobytes.", + "numeric" => "The :attribute field must be greater than :value.", + "string" => "The :attribute field must be greater than :value characters.", + ], + "gte" => [ + "array" => "The :attribute field must have :value items or more.", + "file" => "The :attribute field must be greater than or equal to :value kilobytes.", + "numeric" => "The :attribute field must be greater than or equal to :value.", + "string" => "The :attribute field must be greater than or equal to :value characters.", + ], + "hex_color" => "The :attribute field must be a valid hexadecimal color.", + "image" => "The :attribute field must be an image.", + "in" => "The selected :attribute is invalid.", + "in_array" => "The :attribute field must exist in :other.", + "integer" => "The :attribute field must be an integer.", + "ip" => "The :attribute field must be a valid IP address.", + "ipv4" => "The :attribute field must be a valid IPv4 address.", + "ipv6" => "The :attribute field must be a valid IPv6 address.", + "json" => "The :attribute field must be a valid JSON string.", + "list" => "The :attribute field must be a list.", + "lowercase" => "The :attribute field must be lowercase.", + "lt" => [ + "array" => "The :attribute field must have less than :value items.", + "file" => "The :attribute field must be less than :value kilobytes.", + "numeric" => "The :attribute field must be less than :value.", + "string" => "The :attribute field must be less than :value characters.", + ], + "lte" => [ + "array" => "The :attribute field must not have more than :value items.", + "file" => "The :attribute field must be less than or equal to :value kilobytes.", + "numeric" => "The :attribute field must be less than or equal to :value.", + "string" => "The :attribute field must be less than or equal to :value characters.", + ], + "mac_address" => "The :attribute field must be a valid MAC address.", + "max" => [ + "array" => "The :attribute field must not have more than :max items.", + "file" => "The :attribute field must not be greater than :max kilobytes.", + "numeric" => "The :attribute field must not be greater than :max.", + "string" => "The :attribute field must not be greater than :max characters.", + ], + "max_digits" => "The :attribute field must not have more than :max digits.", + "mimes" => "The :attribute field must be a file of type: :values.", + "mimetypes" => "The :attribute field must be a file of type: :values.", + "min" => [ + "array" => "The :attribute field must have at least :min items.", + "file" => "The :attribute field must be at least :min kilobytes.", + "numeric" => "The :attribute field must be at least :min.", + "string" => "The :attribute field must be at least :min characters.", + ], + "min_digits" => "The :attribute field must have at least :min digits.", + "missing" => "The :attribute field must be missing.", + "missing_if" => "The :attribute field must be missing when :other is :value.", + "missing_unless" => "The :attribute field must be missing unless :other is :value.", + "missing_with" => "The :attribute field must be missing when :values is present.", + "missing_with_all" => "The :attribute field must be missing when :values are present.", + "multiple_of" => "The :attribute field must be a multiple of :value.", + "not_in" => "The selected :attribute is invalid.", + "not_regex" => "The :attribute field format is invalid.", + "numeric" => "The :attribute field must be a number.", + "password" => [ + "letters" => "The :attribute field must contain at least one letter.", + "mixed" => "The :attribute field must contain at least one uppercase and one lowercase letter.", + "numbers" => "The :attribute field must contain at least one number.", + "symbols" => "The :attribute field must contain at least one symbol.", + "uncompromised" => "The given :attribute has appeared in a data leak. Please choose a different :attribute.", + ], + "present" => "The :attribute field must be present.", + "present_if" => "The :attribute field must be present when :other is :value.", + "present_unless" => "The :attribute field must be present unless :other is :value.", + "present_with" => "The :attribute field must be present when :values is present.", + "present_with_all" => "The :attribute field must be present when :values are present.", + "prohibited" => "The :attribute field is prohibited.", + "prohibited_if" => "The :attribute field is prohibited when :other is :value.", + "prohibited_unless" => "The :attribute field is prohibited unless :other is in :values.", + "prohibits" => "The :attribute field prohibits :other from being present.", + "regex" => "The :attribute field format is invalid.", + "required" => "The :attribute field is required.", + "required_array_keys" => "The :attribute field must contain entries for: :values.", + "required_if" => "The :attribute field is required when :other is :value.", + "required_if_accepted" => "The :attribute field is required when :other is accepted.", + "required_if_declined" => "The :attribute field is required when :other is declined.", + "required_unless" => "The :attribute field is required unless :other is in :values.", + "required_with" => "The :attribute field is required when :values is present.", + "required_with_all" => "The :attribute field is required when :values are present.", + "required_without" => "The :attribute field is required when :values is not present.", + "required_without_all" => "The :attribute field is required when none of :values are present.", + "same" => "The :attribute field must match :other.", + "size" => [ + "array" => "The :attribute field must contain :size items.", + "file" => "The :attribute field must be :size kilobytes.", + "numeric" => "The :attribute field must be :size.", + "string" => "The :attribute field must be :size characters.", + ], + "starts_with" => "The :attribute field must start with one of the following: :values.", + "string" => "The :attribute field must be a string.", + "timezone" => "The :attribute field must be a valid timezone.", + "unique" => "The :attribute has already been taken.", + "uploaded" => "The :attribute failed to upload.", + "uppercase" => "The :attribute field must be uppercase.", + "url" => "The :attribute field must be a valid URL.", + "ulid" => "The :attribute field must be a valid ULID.", + "uuid" => "The :attribute field must be a valid UUID.", + "custom" => [ + "attribute-name" => [ + "rule-name" => "custom-message", + ], + ], + "attributes" => [], +]; diff --git a/lang/pl/auth.php b/lang/pl/auth.php new file mode 100644 index 00000000..b8255a78 --- /dev/null +++ b/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.", +]; diff --git a/lang/pl/pagination.php b/lang/pl/pagination.php new file mode 100644 index 00000000..49e8df0e --- /dev/null +++ b/lang/pl/pagination.php @@ -0,0 +1,8 @@ + "Następna", + "previous" => "Poprzednia", +]; diff --git a/lang/pl/passwords.php b/lang/pl/passwords.php new file mode 100644 index 00000000..2a4dd05e --- /dev/null +++ b/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.", +]; diff --git a/lang/pl/validation.php b/lang/pl/validation.php new file mode 100644 index 00000000..5fa78ed0 --- /dev/null +++ b/lang/pl/validation.php @@ -0,0 +1,140 @@ + "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.", + + "custom" => [ + "school_id" => [ + "required" => "Pole :attribute jest wymagane.", + "exists" => "Szkoła nie istnieje. Sprawdź ponownie.", + ], + "surname" => [ + "required" => "Pole :attribute jest wymagane.", + "max" => "Pole :attribute nie może być dłuższe niż :max znaków.", + ], + "name" => [ + "required" => "Pole :attribute jest wymagane.", + "max" => "Pole :attribute nie może być dłuższe niż :max znaków.", + ], + ], + "attributes" => [ + "name" => "imię", + "surname" => "nazwisko", + "email" => "e-mail", + "date" => "data", + "password" => "hasło", + "school_id" => "szkoła", + ], +]; diff --git a/resources/js/Pages/Auth/ForgotPassword.vue b/resources/js/Pages/Auth/ForgotPassword.vue new file mode 100644 index 00000000..6114b281 --- /dev/null +++ b/resources/js/Pages/Auth/ForgotPassword.vue @@ -0,0 +1,30 @@ + + + diff --git a/resources/js/Pages/Auth/ResetPassword.vue b/resources/js/Pages/Auth/ResetPassword.vue new file mode 100644 index 00000000..2eb4f67f --- /dev/null +++ b/resources/js/Pages/Auth/ResetPassword.vue @@ -0,0 +1,44 @@ + + + diff --git a/resources/js/Pages/Home.vue b/resources/js/Pages/Home.vue index 329ce6ae..0d502cc4 100644 --- a/resources/js/Pages/Home.vue +++ b/resources/js/Pages/Home.vue @@ -5,8 +5,15 @@ import AuthBanner from '@/components/Home/AuthBanner.vue' import GeneralSection from '@/components/Home/GeneralSection.vue' import AuthSection from '@/components/Home/AuthSection.vue' import BackgroundEffect from '@/components/Home/BackgroundEffect.vue' +import type {School} from '@/Types/School' const isLogin = ref(null) + +const { errors, schools } = defineProps<{ + errors: Record + schools: School[] +}>() + provide('isLoginRef', isLogin) @@ -16,7 +23,7 @@ provide('isLoginRef', isLogin)
- +