diff --git a/Screenshot 2026-08-16 081815.png b/Screenshot 2026-08-16 081815.png
deleted file mode 100644
index 7b28331..0000000
Binary files a/Screenshot 2026-08-16 081815.png and /dev/null differ
diff --git a/Screenshot 2026-08-16 081927.png b/Screenshot 2026-08-16 081927.png
deleted file mode 100644
index 8d8a9d8..0000000
Binary files a/Screenshot 2026-08-16 081927.png and /dev/null differ
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index df3b676..d963bdd 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -3,7 +3,10 @@
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
-use Illuminate\Http\Request;
+use App\Http\Requests\LoginPostRequest;
+use App\Models\User;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\Hash;
class LoginController extends Controller
{
@@ -16,8 +19,26 @@ class LoginController extends Controller
}
- public function post()
+ public function post(LoginPostRequest $request)
{
+ $user = User::query()
+ ->whereEmail($request->input('email'))
+ ->first();
+ if (!$user) {
+ return back()->withErrors([
+ 'general' => 'اطلاعات کاربر اشتباه است.'
+ ])->withInput();
+ }
+
+ if (!Hash::check($request->input('password'), $user->password)) {
+ return back()->withErrors([
+ 'general' => 'اطلاعات کاربر اشتباه است.'
+ ])->withInput();
+ }
+
+ Auth::login($user);
+
+ return redirect()->route('index');
}
}
diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php
index 1259e9b..aaf3e7d 100644
--- a/resources/views/auth/login.blade.php
+++ b/resources/views/auth/login.blade.php
@@ -20,6 +20,10 @@
با حساب MyTrip خود وارد شوید
+ + @error('general') + {{$message}} + @enderror