feat:add serch for city and province in registet on user side
This commit is contained in:
@@ -21,6 +21,7 @@ class LogInController extends Controller
|
|||||||
|
|
||||||
public function post(LoginPostRequest $request)
|
public function post(LoginPostRequest $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$user = User::query()
|
$user = User::query()
|
||||||
->whereEmail($request->input('email'))
|
->whereEmail($request->input('email'))
|
||||||
->first();
|
->first();
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Auth;
|
namespace App\Http\Controllers\Auth;
|
||||||
|
use App\Models\Province;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
use App\Enums\UserStatus;
|
use App\Enums\UserStatus;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests\RegisterPostRequest;
|
use App\Http\Requests\RegisterPostRequest;
|
||||||
@@ -17,7 +18,9 @@ class RegisterController extends Controller
|
|||||||
{
|
{
|
||||||
$withoutHeader = true;
|
$withoutHeader = true;
|
||||||
$withoutFooter = true;
|
$withoutFooter = true;
|
||||||
return view('auth.register', compact('withoutHeader', 'withoutFooter'));
|
$provinces = Province::all();
|
||||||
|
return view('auth.register', compact('withoutHeader',
|
||||||
|
'withoutFooter','provinces'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function post(RegisterPostRequest $request)
|
public function post(RegisterPostRequest $request)
|
||||||
@@ -55,4 +58,11 @@ class RegisterController extends Controller
|
|||||||
|
|
||||||
return redirect()->route('index');
|
return redirect()->route('index');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function cities(Province $province): JsonResponse
|
||||||
|
{
|
||||||
|
$cities = $province->cities()->get();
|
||||||
|
|
||||||
|
return response()->json($cities);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ use Illuminate\Http\Request;
|
|||||||
|
|
||||||
class IndexController extends Controller
|
class IndexController extends Controller
|
||||||
{
|
{
|
||||||
//
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
$title = 'صفحه اصلی';
|
||||||
|
|
||||||
$flights = Flight::query()
|
$flights = Flight::query()
|
||||||
->with([
|
->with([
|
||||||
'departureAirport.city',
|
'departureAirport.city',
|
||||||
@@ -27,7 +29,7 @@ class IndexController extends Controller
|
|||||||
->take(10)
|
->take(10)
|
||||||
->paginate();
|
->paginate();
|
||||||
|
|
||||||
return view('index', compact('flights', 'tours'));
|
return view('index', compact('flights', 'tours','title'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,15 +78,8 @@ class RegisterPostRequest extends FormRequest
|
|||||||
'mimes:jpg,jpeg,png,webp',
|
'mimes:jpg,jpeg,png,webp',
|
||||||
'max:800',
|
'max:800',
|
||||||
],
|
],
|
||||||
'province_id' => [
|
'province_id' => ['nullable', 'string'],
|
||||||
'nullable',
|
'city_id' => ['nullable', 'string'],
|
||||||
'exists:provinces,id',
|
|
||||||
],
|
|
||||||
|
|
||||||
'city_id' => [
|
|
||||||
'nullable',
|
|
||||||
'exists:cities,id',
|
|
||||||
],
|
|
||||||
|
|
||||||
'password' => [
|
'password' => [
|
||||||
'required',
|
'required',
|
||||||
|
|||||||
@@ -9,7 +9,13 @@
|
|||||||
<meta name="description" content>
|
<meta name="description" content>
|
||||||
<meta name="keywords" content>
|
<meta name="keywords" content>
|
||||||
|
|
||||||
<title>مای تریپ - قالب الگوی رزرو سفر</title>
|
<title>
|
||||||
|
{{config('project.title')}}
|
||||||
|
@isset($title)
|
||||||
|
|
|
||||||
|
{{$title}}
|
||||||
|
@endisset
|
||||||
|
</title>
|
||||||
|
|
||||||
<link rel="icon" type="image/x-icon" href="{{asset('assets/img/logo/favicon.png')}}">
|
<link rel="icon" type="image/x-icon" href="{{asset('assets/img/logo/favicon.png')}}">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user