Sms verification ok

This commit is contained in:
2023-12-02 13:36:50 +05:00
parent d6fd71e0dd
commit d9ea58608b
25 changed files with 692 additions and 169 deletions

51
app/Helpers/helpers.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
use App\Models\System\Verification;
use Illuminate\Http\Client\Client;
use Illuminate\Support\Facades\Log;
/**
* Send a sms
*
* @return void
*/
function sendSMS(string|int $phone, string|int $message)
{
$client = new Client();
$headers = [
'Content-Type' => 'application/json;charset=utf-8;',
'Charset' => 'UTF-8'
];
$body = '{
"SendRequest": {
"TerminalID": "Online_PANEL",
"Version": "1",
"Lang": "EN",
"MobilePhone": "993'.$phone.'",
"Text": "'. $message .'"
}
}';
$request = new Request('POST', 'http://10.3.158.103:8080/kpsmsroute/online.request', $headers, $body);
try {
$res = $client->sendAsync($request, $options)->wait();
return $res->getBody();
} catch (\Exception $e) {
Log::error($e);
}
}
/**
* Send a sms verification code
*/
function sendSMSVerification(string|int $phone_number): ?Verification
{
$phone_code = rand(10000, 99999);
$verification = Verification::where(['username' => $phone_number])->first();
$verification ? $verification->update(['code' => $phone_code]) : Verification::create(['username' => $phone_number, 'code' => $phone_code]);
sendSMS($phone_number, 'Tassyklaýyş belgi: '.$phone_code);
return $verification;
}

View File

@@ -0,0 +1,121 @@
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth;
use Laravel\Nova\Nova;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers, ValidatesRequests;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('nova.guest:'.config('nova.guard'))->except('logout');
}
/**
* Show the application's login form.
*
* @return \Inertia\Response|\Symfony\Component\HttpFoundation\Response
*/
public function showLoginForm()
{
return view('vendor.nova.pages.login');
}
/**
* The user has been authenticated.
*
* @param mixed $user
* @return mixed
*/
protected function authenticated(Request $request, $user)
{
$redirect = redirect()->intended($this->redirectPath());
return $request->wantsJson()
? new JsonResponse([
'redirect' => $redirect->getTargetUrl(),
], 200)
: $redirect;
}
/**
* Log the user out of the application.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function logout(Request $request)
{
$this->guard()->logout();
$request->session()->invalidate();
return redirect()->intended($this->redirectPath());
}
/**
* Get the post register / login redirect path.
*
* @return string
*/
public function redirectPath()
{
return Nova::url(Nova::$initialPath);
}
/**
* Get the guard to be used during authentication.
*
* @return \Illuminate\Contracts\Auth\StatefulGuard
*/
protected function guard()
{
return Auth::guard(config('nova.guard'));
}
/**
* Get the login username to be used by the controller.
*/
public function username(): string
{
return 'username';
}
/**
* Validate the user login request.
*
* @return void
*
* @throws \Illuminate\Validation\ValidationException
*/
protected function validateLogin(Request $request)
{
$request->validate([
$this->username() => ['required', 'string', 'max:250', 'exists:users,username'],
'password' => ['required', 'string', 'max:250'],
]);
}
}

View File

@@ -0,0 +1,107 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Auth\Events\Registered;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
/**
* Show registration page
*/
public function showNovaRegisterpageForm(): View
{
return view('vendor.nova.pages.register');
}
/**
* Handle a registration request for the application.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
*/
public function register(Request $request)
{
$this->middleware('guest');
$this->validator($request->all())->validate();
event(new Registered($user = $this->create($request->all())));
Auth::guard()->login($user);
sendSMSVerification($user->phone);
return to_route('sms-verification');
}
/**
* Get a validator for an incoming registration request.
*
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
$data['phone'] = substr(str_replace(['+', '(', ')', '-', '_'], '', $data['phone']), 3);
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'phone' => ['required', 'integer', 'between:61000000,671999999', 'unique:users,phone'],
'username' => ['required', 'string', 'alpha_dash:ascii', 'max:255', 'unique:users,username'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.
*
* @return \App\Models\User
*/
protected function create(array $data)
{
$user = User::create([
'name' => $data['name'],
'phone' => $data['phone'],
'username' => $data['username'],
'password' => Hash::make($data['password']),
'active' => true,
]);
return $user;
}
/**
* Sms verification
*/
public function smsVerification()
{
return view('vendor.nova.pages.sms-verification');
}
/**
* Verify sms code
*/
public function verifySmsCode()
{
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Models\System;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Verification extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'username',
'code',
];
}

View File

@@ -24,10 +24,14 @@ class User extends Authenticatable
* @var array<int, string>
*/
protected $fillable = [
'username',
'name',
'email',
'phone',
'email_verified_at',
'password',
'locale',
'active',
];
/**

View File

@@ -26,7 +26,6 @@ class StatusFilter extends Filter
/**
* Apply the filter to the given query.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @param \Illuminate\Database\Eloquent\Builder $query
* @param mixed $value
* @return \Illuminate\Database\Eloquent\Builder
@@ -38,9 +37,6 @@ class StatusFilter extends Filter
/**
* Get the filter's available options.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array
*/
public function options(NovaRequest $request): array
{

View File

@@ -5,7 +5,6 @@ namespace App\Nova\Resources\Order\Loan;
use App\Models\Branch\Branch;
use App\Models\Order\Loan\LoanOrder as LoanOrderModel;
use App\Models\System\Location\Province;
use App\Nova\Filters\ActiveFilter;
use App\Nova\Filters\RegionFilter;
use App\Nova\Filters\StatusFilter;
use App\Nova\Resource;

View File

@@ -4,6 +4,7 @@ namespace App\Nova;
use App\Nova\Resources\Branch\Branch;
use App\Nova\Resources\System\Roles\Role;
use App\Rules\OnlyLetters;
use Illuminate\Http\Request;
use Illuminate\Validation\Rules;
use Laravel\Nova\Fields\BelongsToMany;
@@ -12,6 +13,8 @@ use Laravel\Nova\Fields\MorphToMany;
use Laravel\Nova\Fields\Password;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Nurmuhammet\NovaInputmask\NovaInputmask;
use Trin4ik\NovaSwitcher\NovaSwitcher;
class User extends Resource
{
@@ -76,24 +79,42 @@ class User extends Resource
return [
ID::make()->sortable(),
Text::make('Name')
Text::make(__('Username'), 'username')
->sortable()
->rules('required', 'string', new OnlyLetters(), 'max:250')
->creationRules('unique:users,username')
->updateRules('unique:users,username,{{resourceId}}'),
Text::make(__('Name'), 'name')
->sortable()
->rules('required', 'max:255'),
Text::make('Email')
NovaInputmask::make(__('Phone'), 'phone')
->mask('+(\\9\\93)-99-99-99-99')
->storeRawValue()
->size('w-1/4')
->rules('required', 'integer', 'between:61000000, 71999999'),
Text::make(__('Email'), 'email')
->sortable()
->rules('required', 'email', 'max:254')
->creationRules('unique:users,email')
->updateRules('unique:users,email,{{resourceId}}'),
Password::make('Password')
Password::make(__('Password'), 'password')
->onlyOnForms()
->creationRules('required', Rules\Password::defaults())
->updateRules('nullable', Rules\Password::defaults()),
MorphToMany::make(__('Roles'), 'roles', Role::class),
NovaSwitcher::make(__('Active'), 'active')
->default(true)
->canSeeWhen('isAdmin', $this),
BelongsToMany::make(__('Branches'), 'branches', Branch::class),
MorphToMany::make(__('Roles'), 'roles', Role::class)
->canSeeWhen('isAdmin', $this),
BelongsToMany::make(__('Branches'), 'branches', Branch::class)
->canSeeWhen('isAdmin', $this),
];
}

View File

@@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider
*
* @var string
*/
public const HOME = '/home';
public const HOME = '/';
/**
* Define your route model bindings, pattern filters, and other route configuration.

View File

@@ -36,7 +36,10 @@
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"files": [
"app/Helpers/helpers.php"
]
},
"autoload-dev": {
"psr-4": {

View File

@@ -203,4 +203,14 @@ return [
'stopped' => '/',
],
/*
|--------------------------------------------------------------------------
| Nova Routes
|--------------------------------------------------------------------------
|
*/
'routes' => [
'login' => '/login',
'register' => '/register',
],
];

View File

@@ -13,10 +13,12 @@ return new class extends Migration
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('username')->unique();
$table->string('name');
$table->string('email')->unique();
$table->string('email')->nullable()->unique();
$table->string('phone')->nullable()->unique();
$table->timestamp('email_verified_at')->nullable();
$table->timestamp('phone_verified_at')->nullable();
$table->string('password');
$table->string('locale')->default('tk');
$table->boolean('active')->default(true);

View File

@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::dropIfExists('loan_types');
Schema::create('loan_types', function (Blueprint $table) {
$table->id();
$table->jsonb('name');

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('verifications', function (Blueprint $table) {
$table->id();
$table->string('username');
$table->string('code');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('verifications');
}
};

View File

@@ -36,14 +36,17 @@ class UsersTableSeeder extends Seeder
{
$admins = [
[
'username' => 'nurmuhammet',
'name' => 'Nurmuhammet Allanov',
'email' => 'nurmuhammet@mail.com',
'password' => '$2y$10$O7LFNdFIT3Rmfeo8tUfbqekB0x0incovkRP6eQuzvb7dVXysQyyBC',
], [
'username' => 'mahmyt',
'name' => 'Mahmyt Allaberdiyev',
'email' => 'mahmyt1206@gmail.com',
'password' => '$2y$10$O7LFNdFIT3Rmfeo8tUfbqekB0x0incovkRP6eQuzvb7dVXysQyyBC',
], [
'username' => 'dowran',
'name' => 'Döwran Myratlyýew',
'email' => 'dovran.m@mail.ru',
'password' => '$2y$10$EFQaBb.aM2KJRGGtuhjdM.3m4Mtm/vw68NjU2280d2RICDGI.o336',

View File

@@ -24,7 +24,7 @@
"click here to request another": "başga birini soramak üçin şu ýere basyň",
"Client Closed Request": "Müşderiniň ýapyk haýyşy",
"Completed": "Tamamlanan",
"Confirm Password": "Paroly tassykla",
"Confirm Password": "Açar sözüni tassykla",
"Conflict": "Konflikt",
"Connection Closed Without Response": "Jogapsyz birikme ýapyldy",
"Connection Timed Out": "Baglanyşyk wagty gutardy",
@@ -42,7 +42,7 @@
"Expectation Failed": "Garaşmak başa barmady",
"Failed Dependency": "Şowsuzlyk",
"Forbidden": "Gadagan",
"Forgot Your Password?": "Parolyňyzy ýatdan çykardyňyzmy?",
"Forgot Your Password?": "Açar sözüni ýatdan çykardyňyzmy?",
"Found": "Tapyldy",
"Gateway Timeout": "Derweze wagty",
"Go to page :page": ":Page-nji sahypa geçiň",
@@ -75,6 +75,7 @@
"Location": "Lokasiýa",
"Locked": "Gulply",
"Login": "Giriş",
"Forgot your password?": "Açar sözüni ýatdan çykardyňyzmy?",
"Logout": "Hasapdan çykmak",
"Loop Detected": "Aýlaw tapyldy",
"Maintenance Mode": "Bejeriş tertibi",
@@ -120,7 +121,7 @@
"Passport given by": "Kim tarapyndan berildi",
"Passport id": "Pasport belgisi",
"Passport serie": "Pasport seriýasy",
"Password": "Parol",
"Password": "Açar sözi",
"Patronic name": "Ataňyzyň ady",
"Payload Too Large": "Loadük gaty uly",
"Payment Required": "Töleg talap edilýär",
@@ -131,7 +132,7 @@
"Phone": "Telefon",
"Phone Additional": "Telefon goşmaça",
"Please click the button below to verify your email address.": "E-poçta salgyňyzy barlamak üçin aşakdaky düwmä basyň.",
"Please confirm your password before continuing.": "Dowam etmezden ozal parolyňyzy tassyklaň.",
"Please confirm your password before continuing.": "Dowam etmezden ozal açar sözüni tassyklaň.",
"Position": "Wezipe",
"Precondition Failed": "Deslapky şert şowsuz",
"Precondition Required": "Deslapky şert",
@@ -144,14 +145,15 @@
"Regards": "Hormat bilen",
"Region": "Welaýat",
"Regions": "Welaýatlar",
"Register": "Hasaba al",
"Register": "Agza bolmak",
"Registered": "Bellige alyndy",
"Remember Me": "Meni ýatda sakla",
"Remember me": "Meni ýatda sakla",
"Welcome Back!": "Hoş geldiňiz!",
"Request Header Fields Too Large": "Sözbaşy meýdanlaryny gaty uly haýyş",
"Request Timeout": "Wagt gutarmagyny haýyş",
"Reset Content": "Mazmuny täzeden düzmek",
"Reset Password": "Paroly täzeden düzmek",
"Reset Password Notification": "Parol habarnamasyny täzeden düzmek",
"Reset Password": "Açar sözüni täzelemek",
"Reset Password Notification": "Reset Password Notification",
"Residence (passport)": "Ýazgy edilen salgyňyz",
"results": "Netijeler",
"Retry With": "Gaýtadan synanyşyň",
@@ -195,6 +197,7 @@
"User": "Ulanyjy",
"Users": "Ulanyjylar",
"Variant Also Negotiates": "Wariant hem gepleşik geçirýär",
"Verify Phone Number": "Telefon beligiňizi tassyklaň",
"Verify Email Address": "E-poçta salgysyny barlaň",
"Verify Your Email Address": "E-poçta salgyňyzy barlaň",
"Web Server is Down": "Web Serwer ýapyk",
@@ -210,5 +213,10 @@
"Full Name": "Doly ady",
"Activity": "Işjeňlik",
"Active": "Işjeň",
"Inactive": "Işjeň däl"
"Inactive": "Işjeň däl",
"Online panel": "Onlaýn kabulhana",
"Username": "Ulanyjy ady",
"Go to login page": "Login sahypa geç",
"Submit": "Tassyklamak",
"Verification code": "Tassyklaýyş belgi"
}

View File

@@ -9,7 +9,7 @@ return [
'after' => ':Attribute şundan has köne sene bolmalydyr :date.',
'after_or_equal' => ':Attribute-den soň bir sene bolmaly ýa-da :date-e deň bolmaly.',
'alpha' => ':Attribute dine harplardan bolmaly.',
'alpha_dash' => ':Attribute dine harplardan, sanlardan we tirelerden durmalydyr.',
'alpha_dash' => ':Attribute dine harplardan, sanlardan we çyzyjaklardan durmalydyr.',
'alpha_num' => ':Attribute dine harplardan we sanlardan durmalydyr.',
'array' => ':Attribute ýygyndy bolmalydyr.',
'ascii' => ':Attribute-de diňe bir baýtly harp sanlary we nyşanlary bolmaly.',
@@ -24,7 +24,7 @@ return [
'boolean' => ':Attribute diňe dogry ýada ýalňyş bolmalydyr.',
'can' => ':Attribute meýdanda birugsat baha bar.',
'confirmed' => ':Attribute tassyklamasy deň däl.',
'current_password' => 'Parol nädogry',
'current_password' => 'Açar sözi nädogry',
'date' => ':Attribute dogry sene bolmalydyr.',
'date_equals' => ':Attribute-i :date-e deň bolan sene bolmaly.',
'date_format' => ':Attribute :format formatyna deň däl.',
@@ -160,7 +160,7 @@ return [
'country' => 'ýurt',
'created_at' => 'döredildi',
'creator' => 'dörediji',
'current_password' => 'Hazirki parolynyz',
'current_password' => 'Hazirki açar sözüňiz',
'date' => 'senesi',
'date_of_birth' => 'doglan gün',
'day' => 'gün',
@@ -188,8 +188,8 @@ return [
'name' => 'ady',
'national_code' => 'milli kod',
'number' => 'sany',
'password' => 'parol',
'password_confirmation' => 'paroly tassyklamak',
'password' => 'açar sözi',
'password_confirmation' => 'açar sözini tassyklamak',
'phone' => 'telefon',
'photo' => 'surat',
'postal_code' => 'poçta kody',

View File

@@ -166,7 +166,7 @@
"Force Delete Resource": "Resurslary doly poz",
"Force Delete Selected": "Saýlananlary poz",
"Forgot Password": "Paroly ýatdan çykardy",
"Forgot your password?": "Parolyňyzy ýatdan çykardyňyzmy?",
"Forgot your password?": "Açar sözüni ýatdan çykardyňyzmy?",
"France": "Fransiýa",
"French Guiana": "Fransuz Gwiana",
"French Polynesia": "Fransuz polineziýasy",

8
public/assets/js/inputmask.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="tk" dir="ltr" class="h-full font-sans antialiased">
<head>
<meta name="theme-color" content="#fff">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width"/>
<meta name="locale" content="tk"/>
<meta name="robots" content="noindex">
<!-- Styles -->
<link rel="stylesheet" href="/vendor/nova/app.css?id=496e3383c5e2918c7bc875f45870e701">
<style>
.bg-secondary-500 {
background-color: rgb(186,230,253);
}
.hover:bg-secondary-400 {
background-color: rgba(24, 182, 155, 0.5);
}
</style>
</head>
<body class="min-w-site text-sm font-medium min-h-full text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-900">
<div class="py-6 px-1 md:px-2 lg:px-6">
<div class="mx-auto py-8 max-w-sm flex justify-center">
<span class="text-4xl">{{ __('Online panel') }}</span>
</div>
<div>
<form class="bg-white dark:bg-gray-800 shadow rounded-lg p-8 max-w-[25rem] mx-auto" method="POST" action="{{ route('login') }}">
@csrf
<h2 class="text-2xl text-center font-normal mb-6">{{ __('Welcome Back!') }}</h2>
<svg class="block mx-auto mb-6" xmlns="http://www.w3.org/2000/svg" width="100" height="2" viewBox="0 0 100 2">
<path fill="#D8E3EC" d="M0 0h100v2H0z"></path>
</svg>
<div class="mb-6">
<label class="block mb-2" for="username">
{{ __('Username') }}
</label>
<input class="form-control form-input form-input-bordered w-full" id="username" type="text" name="username" autofocus="" required="">
</div>
<div class="mb-6">
<label class="block mb-2" for="password">
{{ __('Password') }}
</label>
<input class="form-control form-input form-input-bordered w-full" id="password" type="password" name="password" required="">
@if($errors->any())
@foreach($errors->all() as $error)
<p class="mt-2 text-red-500">{{ $error }}</p>
@endforeach
@endif
</div>
<div class="flex mb-6">
<div class="ml-auto">
<a class="text-gray-500 font-bold no-underline" href="">
{{ __('Forgot your password?') }}
</a>
</div>
</div>
<button class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center" type="submit">
<span class=""><span>{{ __('Login') }}</span></span>
</button>
<a href="{{ route('register') }}" class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center">
<span class=""><span>{{ __('Register') }}</span></span>
</a>
</form>
</div>
</div>
<script src="/assets/js/inputmask.min.js"></script>
</body>
</html>

View File

@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}" dir="ltr" class="h-full font-sans antialiased">
<head>
<meta name="theme-color" content="#fff">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width"/>
<meta name="locale" content="{{ app()->getLocale() }}"/>
<meta name="robots" content="noindex">
<!-- Styles -->
<link rel="stylesheet" href="/vendor/nova/app.css?id=496e3383c5e2918c7bc875f45870e701">
<style>
.bg-secondary-500 {
background-color: rgb(186,230,253);
}
.hover:bg-secondary-400 {
background-color: rgba(24, 182, 155, 0.5);
}
</style>
</head>
<body class="min-w-site text-sm font-medium min-h-full text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-900">
<div class="py-6 px-1 md:px-2 lg:px-6">
<div class="mx-auto py-8 max-w-sm flex justify-center">
<span class="text-4xl">{{ __('Online panel') }}</span>
</div>
<div>
<form class="bg-white dark:bg-gray-800 shadow rounded-lg p-8 max-w-[25rem] mx-auto" method="POST" action="{{ route('register') }}">
@csrf
<h2 class="text-2xl text-center font-normal mb-6">{{ __('Welcome Back!') }}</h2>
<svg class="block mx-auto mb-6" xmlns="http://www.w3.org/2000/svg" width="100" height="2" viewBox="0 0 100 2">
<path fill="#D8E3EC" d="M0 0h100v2H0z"></path>
</svg>
<div class="mb-1">
<label class="block mb-1" for="username">
{{ __('Full Name') }}
</label>
<input class="form-control form-input form-input-bordered w-full @error('name') form-input-border-error @enderror" id="name" type="text" name="name" autofocus="" required="" value="{{ old('name') }}">
@error('name')
<span class="text-red-500 text-italic">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="mb-1">
<label class="block mb-1" for="username">
{{ __('Phone') }}
</label>
<input class="form-control form-input form-input-bordered w-full" id="phone" type="text" name="phone" autofocus="" required="" value="{{ old('phone') }}">
@error('phone')
<span class="text-red-500 text-italic">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="mb-1">
<label class="block mb-1" for="username">
{{ __('Username') }}
</label>
<input class="form-control form-input form-input-bordered w-full" id="username" type="text" name="username" autofocus="" required="" value="{{ old('username') }}">
@error('username')
<span class="text-red-500 text-italic">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="mb-1">
<label class="block mb-1" for="password">
{{ __('Password') }}
</label>
<input class="form-control form-input form-input-bordered w-full" id="password" type="password" name="password" required="">
@error('password')
<span class="text-red-500 text-italic">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="mb-1">
<label class="block mb-1" for="password_confirmation">
{{ __('Confirm Password') }}
</label>
<input class="form-control form-input form-input-bordered w-full" id="password_confirmation" type="password" name="password_confirmation" required="">
@error('password_confirmation')
<span class="text-red-500 text-italic">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="flex mb-6">
<div class="ml-auto">
<a class="text-gray-500 font-bold no-underline" href="">
{{ __('Forgot your password?') }}
</a>
</div>
</div>
<button class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center" type="submit">
<span class=""><span>{{ __('Register') }}</span></span>
</button>
<a href="{{ route('login') }}" class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center">
<span class=""><span>{{ __('Go to login page') }}</span></span>
</a>
</form>
</div>
</div>
<script src="/assets/js/inputmask.min.js"></script>
<script>
new Inputmask("+(\\9\\93)-99-99-99-99").mask(document.getElementById('phone'));
</script>
</body>
</html>

View File

@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="tk" dir="ltr" class="h-full font-sans antialiased">
<head>
<meta name="theme-color" content="#fff">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width"/>
<meta name="locale" content="tk"/>
<meta name="robots" content="noindex">
<!-- Styles -->
<link rel="stylesheet" href="/vendor/nova/app.css?id=496e3383c5e2918c7bc875f45870e701">
<style>
.bg-secondary-500 {
background-color: rgb(186,230,253);
}
.hover:bg-secondary-400 {
background-color: rgba(24, 182, 155, 0.5);
}
</style>
</head>
<body class="min-w-site text-sm font-medium min-h-full text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-900">
<div class="py-6 px-1 md:px-2 lg:px-6">
<div class="mx-auto py-8 max-w-sm flex justify-center">
<span class="text-4xl">{{ __('Online panel') }}</span>
</div>
<div>
<form class="bg-white dark:bg-gray-800 shadow rounded-lg p-8 max-w-[25rem] mx-auto" method="POST" action="{{ route('login') }}">
@csrf
<h2 class="text-2xl text-center font-normal mb-6">{{ __('Verify Phone Number') }}</h2>
<svg class="block mx-auto mb-6" xmlns="http://www.w3.org/2000/svg" width="100" height="2" viewBox="0 0 100 2">
<path fill="#D8E3EC" d="M0 0h100v2H0z"></path>
</svg>
<div class="mb-6">
<label class="block mb-2" for="code">
{{ __('Verification code') }}
</label>
<input class="form-control form-input form-input-bordered w-full" id="code" type="number" name="code" required="">
@if($errors->any())
@foreach($errors->all() as $error)
<p class="mt-2 text-red-500">{{ $error }}</p>
@endforeach
@endif
</div>
<button class="w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center cursor-pointer rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 inline-flex items-center justify-center h-9 px-3 mb-3 w-full flex justify-center shadow relative bg-primary-500 hover:bg-primary-400 text-white dark:text-gray-900 w-full flex justify-center" type="submit">
<span class=""><span>{{ __('Submit') }}</span></span>
</button>
</form>
</div>
</div>
<script src="/assets/js/inputmask.min.js"></script>
</body>
</html>

View File

@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="h-full font-sans antialiased">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ \Laravel\Nova\Nova::name() }}</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,800,800i,900,900i" rel="stylesheet">
<!-- Styles -->
<link rel="stylesheet" href="{{ mix('app.css', 'vendor/nova') }}">
<!-- Custom Meta Data -->
@include('nova::partials.meta')
<!-- Theme Styles -->
@foreach(\Laravel\Nova\Nova::themeStyles() as $publicPath)
<link rel="stylesheet" href="{{ $publicPath }}">
@endforeach
</head>
<body class="bg-40 text-black h-full">
<div class="h-full">
<div class="px-view py-view mx-auto">
@yield('content')
</div>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,7 @@
<?php
use App\Http\Controllers\Auth\LoginController;
use App\Http\Controllers\Auth\RegisterController;
use Illuminate\Support\Facades\Route;
/*
@@ -13,4 +15,11 @@ use Illuminate\Support\Facades\Route;
|
*/
Route::get('/register', [RegisterController::class, 'showNovaRegisterpageForm'])->name('register');
Route::get('sms-verification', [RegisterController::class, 'smsVerification'])->name('sms-verification');
Route::post('/register', [RegisterController::class, 'register']);
Route::get('/login', [LoginController::class, 'showLoginForm'])->name('login');
Route::post('/login', [LoginController::class, 'login']);
Route::redirect('/', config('nova.path'));