From 3da5b4ed6265f08e1f94df7362102a33f7a55e45 Mon Sep 17 00:00:00 2001 From: Windows Store Date: Sat, 15 Aug 2026 14:50:42 +0330 Subject: [PATCH] feat: add authentication routes and controllers --- app/Http/Controllers/Auth/LoginController.php | 17 ++ .../Controllers/Auth/LogoutController.php | 11 + .../Controllers/Auth/RegisterController.php | 18 ++ bootstrap/app.php | 5 +- composer.json | 4 +- composer.lock | 248 +++++++++++++++++- resources/views/layouts/app.blade.php | 4 +- resources/views/layouts/header.blade.php | 4 +- routes/auth.php | 11 + routes/web.php | 2 + 10 files changed, 317 insertions(+), 7 deletions(-) create mode 100644 app/Http/Controllers/Auth/LoginController.php create mode 100644 app/Http/Controllers/Auth/LogoutController.php create mode 100644 app/Http/Controllers/Auth/RegisterController.php create mode 100644 routes/auth.php diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php new file mode 100644 index 0000000..8ba9eaa --- /dev/null +++ b/app/Http/Controllers/Auth/LoginController.php @@ -0,0 +1,17 @@ +withRouting( - web: __DIR__.'/../routes/web.php', + web: [ + __DIR__.'/../routes/web.php', + __DIR__.'/../routes/auth.php', + ], commands: __DIR__.'/../routes/console.php', health: '/up', ) diff --git a/composer.json b/composer.json index 115a36d..da35d55 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,10 @@ "license": "MIT", "require": { "php": "^8.2", + "hekmatinasser/verta": "^9.0", "laravel/framework": "^12.0", - "laravel/tinker": "^2.10.1" + "laravel/tinker": "^2.10.1", + "sadegh19b/laravel-persian-validation": "^2.1" }, "require-dev": { "fakerphp/faker": "^1.23", diff --git a/composer.lock b/composer.lock index 4545675..c068e1c 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": "08c06dd385602178e63890a24d349efc", + "content-hash": "d2f9c73ad216c4d120251d41cec0c1ee", "packages": [ { "name": "brick/math", @@ -1058,6 +1058,189 @@ ], "time": "2026-07-17T13:53:03+00:00" }, + { + "name": "hekmatinasser/jalali", + "version": "v8.2.4", + "source": { + "type": "git", + "url": "https://github.com/hekmatinasser/jalali.git", + "reference": "423c848ec32fb36e9ab9610d82f98efa2de0f79d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hekmatinasser/jalali/zipball/423c848ec32fb36e9ab9610d82f98efa2de0f79d", + "reference": "423c848ec32fb36e9ab9610d82f98efa2de0f79d", + "shasum": "" + }, + "require": { + "hekmatinasser/notowo": "^1.0", + "php": "^8.0" + }, + "require-dev": { + "orchestra/testbench": "^4.18|^5.20|^6.24|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Hekmatinasser\\Jalali\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nasser Hekmati", + "email": "hekmati.nasser@gmail.com" + } + ], + "description": "This Package helps developers to work with Jalali Datetime class for PHP", + "keywords": [ + "Jalali", + "date", + "datetime", + "php", + "shamsi" + ], + "support": { + "issues": "https://github.com/hekmatinasser/jalali/issues", + "source": "https://github.com/hekmatinasser/jalali/tree/x8.2.3" + }, + "funding": [ + { + "url": "https://github.com/hekmatinasser", + "type": "github" + } + ], + "time": "2024-04-09T12:43:59+00:00" + }, + { + "name": "hekmatinasser/notowo", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/hekmatinasser/notowo.git", + "reference": "c51ad5dcedac966dd93ce558ac7e6a84e0020d6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hekmatinasser/notowo/zipball/c51ad5dcedac966dd93ce558ac7e6a84e0020d6d", + "reference": "c51ad5dcedac966dd93ce558ac7e6a84e0020d6d", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Hekmatinasser\\Notowo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nasser Hekmati", + "email": "hekmati.nasser@gmail.com" + } + ], + "description": "This Package helps developers change number to word for all language on Laravel freamwork PHP", + "keywords": [ + "Notowo", + "laravel", + "n2w", + "number", + "word" + ], + "support": { + "issues": "https://github.com/hekmatinasser/notowo/issues", + "source": "https://github.com/hekmatinasser/notowo/tree/v1.0.1" + }, + "time": "2017-09-22T13:41:16+00:00" + }, + { + "name": "hekmatinasser/verta", + "version": "v9.0", + "source": { + "type": "git", + "url": "https://github.com/hekmatinasser/verta.git", + "reference": "f3cff537f07ef302b1ea24f59e9c1d5e3a1c36cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hekmatinasser/verta/zipball/f3cff537f07ef302b1ea24f59e9c1d5e3a1c36cb", + "reference": "f3cff537f07ef302b1ea24f59e9c1d5e3a1c36cb", + "shasum": "" + }, + "require": { + "hekmatinasser/jalali": "^8.2.3", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "illuminate/validation": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", + "php": "^8.0" + }, + "require-dev": { + "orchestra/testbench": "^6.23|^7.0|^8.0|^11.0" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "Verta": "Hekmatinasser\\Verta\\Verta" + }, + "providers": [ + "Hekmatinasser\\Verta\\Laravel\\VertaServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Hekmatinasser\\Verta\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nasser Hekmati", + "email": "hekmati.nasser@gmail.com" + } + ], + "description": "This Package helps developers to work with Jalali Datetime class for Laravel Framework PHP", + "keywords": [ + "Jalali", + "Verta", + "date", + "datetime", + "laravel", + "shamsi" + ], + "support": { + "issues": "https://github.com/hekmatinasser/verta/issues", + "source": "https://github.com/hekmatinasser/verta/tree/v9.0" + }, + "funding": [ + { + "url": "https://github.com/hekmatinasser", + "type": "github" + } + ], + "time": "2026-05-08T06:26:09+00:00" + }, { "name": "laravel/framework", "version": "v12.66.0", @@ -3299,6 +3482,69 @@ }, "time": "2026-06-18T03:57:49+00:00" }, + { + "name": "sadegh19b/laravel-persian-validation", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/sadegh19b/laravel-persian-validation.git", + "reference": "827b446c54121d9fcb0e06415788645c62f7dcd0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sadegh19b/laravel-persian-validation/zipball/827b446c54121d9fcb0e06415788645c62f7dcd0", + "reference": "827b446c54121d9fcb0e06415788645c62f7dcd0", + "shasum": "" + }, + "require": { + "illuminate/support": "^11.0|^12.0|^13.0", + "php": ">=8.2" + }, + "require-dev": { + "orchestra/testbench": "^9.0", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Sadegh19b\\LaravelPersianValidation\\PersianValidationServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Sadegh19b\\LaravelPersianValidation\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sadegh Barzegar", + "email": "sadegh19b@gmail.com", + "homepage": "https://github.com/sadegh19b", + "role": "Developer" + } + ], + "description": "A comprehensive Laravel validation package for Persian text, numbers, dates, and Iranian national identifiers", + "homepage": "https://github.com/sadegh19b/laravel-persian-validation", + "keywords": [ + "farsi", + "laravel", + "persian", + "validate", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/sadegh19b/laravel-persian-validation/issues", + "source": "https://github.com/sadegh19b/laravel-persian-validation/tree/v2.1.0" + }, + "time": "2026-04-25T07:43:18+00:00" + }, { "name": "symfony/clock", "version": "v8.1.0", diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 1326170..902a09d 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -53,14 +53,14 @@ -@include('layouts.header') +@includeUnless(isset($withoutHeader) , 'layouts.header')
@yield('content')
-@include('layouts.footer') +@includeUnless(isset($withoutFooter) , 'layouts.footer') diff --git a/resources/views/layouts/header.blade.php b/resources/views/layouts/header.blade.php index 8beeaea..0cda282 100644 --- a/resources/views/layouts/header.blade.php +++ b/resources/views/layouts/header.blade.php @@ -42,8 +42,8 @@
- وارد شدن - ثبت نام + وارد شدن + ثبت نام
diff --git a/routes/auth.php b/routes/auth.php new file mode 100644 index 0000000..abe7b86 --- /dev/null +++ b/routes/auth.php @@ -0,0 +1,11 @@ +name('auth.')->middleware('guest')->group(function (){ + Route::get('login' , [LoginController::class , 'index'])->name('login'); + Route::get('register' , [RegisterController::class , 'index'])->name('register'); +}); diff --git a/routes/web.php b/routes/web.php index 518d8da..592d439 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,3 +4,5 @@ use App\Http\Controllers\IndexController; use Illuminate\Support\Facades\Route; Route::get('/' , [IndexController::class , 'index']); + +