Cette révision appartient à :
Ibrahim Khalil 2023-11-13 13:23:00 +06:00
Parent bff35003f6
révision a092f51157
13 fichiers modifiés avec 602 ajouts et 629 suppressions

Voir le fichier

@ -22,10 +22,11 @@ public function signUpStore(SignUpRequest $request)
try { try {
$user = new User; $user = new User;
$user->name_en = $request->name; $user->name_en = $request->name;
$user->contact_en = $request->contact; $user->contact_en = $request->contact_en;
$user->email = $request->email; $user->email = $request->email;
$user->password = Hash::make($request->password); $user->password = Hash::make($request->password);
$user->role_id = 4; $user->role_id = 4;
// dd($request->all());
if ($user->save()) if ($user->save())
return redirect('login')->with('success', 'Successfully Registered'); return redirect('login')->with('success', 'Successfully Registered');
else else
@ -46,7 +47,7 @@ public function signInCheck(SignInRequest $request)
try { try {
$user = User::where('contact_en', $request->username)->orWhere('email', $request->username)->first(); $user = User::where('contact_en', $request->username)->orWhere('email', $request->username)->first();
if ($user) { if ($user) {
if (Hash::check($request->password, $request->username)) { if (Hash::check($request->password, $user->password)) {
$this->setSession($user); $this->setSession($user);
return redirect()->route('dashboard')->with('success', 'Successfully Logged In'); return redirect()->route('dashboard')->with('success', 'Successfully Logged In');
} else } else

Voir le fichier

@ -2,7 +2,7 @@
//Two way encryption method to encrypt sll data from url //Two way encryption method to encrypt sll data from url
function encryption($action, $string) function encryptor($action, $string)
{ {
$output = false; $output = false;

Voir le fichier

@ -11,7 +11,7 @@ class SignInRequest extends FormRequest
*/ */
public function authorize(): bool public function authorize(): bool
{ {
return false; return true;
} }
/** /**

Voir le fichier

@ -11,7 +11,7 @@ class SignUpRequest extends FormRequest
*/ */
public function authorize(): bool public function authorize(): bool
{ {
return false; return true;
} }
/** /**

Voir le fichier

@ -8,4 +8,9 @@
class Role extends Model class Role extends Model
{ {
use HasFactory; use HasFactory;
// relation with user
public function users(){
return $this->hasMany(User::class);
}
} }

Voir le fichier

@ -3,9 +3,36 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Illuminate\Database\Eloquent\SoftDeletes;
class User extends Model class User extends Authenticatable
{ {
use HasFactory; use HasFactory, HasApiTokens, Notifiable, SoftDeletes;
// The attributes that are mass assignable.
protected $fillable = [
'name',
'email',
'password',
];
// The attributes that should be hidden for serialization.
protected $hidden = [
'password',
'remember_token',
];
// The attributes that should be cast.
protected $casts = [
'email_verified_at' => 'datetime',
];
// relation with role
public function role()
{
return $this->belongsTo(Role::class);
}
} }

60
composer.lock générée
Voir le fichier

@ -505,24 +505,24 @@
}, },
{ {
"name": "graham-campbell/result-type", "name": "graham-campbell/result-type",
"version": "v1.1.1", "version": "v1.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/GrahamCampbell/Result-Type.git", "url": "https://github.com/GrahamCampbell/Result-Type.git",
"reference": "672eff8cf1d6fe1ef09ca0f89c4b287d6a3eb831" "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/672eff8cf1d6fe1ef09ca0f89c4b287d6a3eb831", "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/fbd48bce38f73f8a4ec8583362e732e4095e5862",
"reference": "672eff8cf1d6fe1ef09ca0f89c4b287d6a3eb831", "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.1" "phpoption/phpoption": "^1.9.2"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12" "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -551,7 +551,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/GrahamCampbell/Result-Type/issues", "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.1" "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.2"
}, },
"funding": [ "funding": [
{ {
@ -563,7 +563,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-25T20:23:15+00:00" "time": "2023-11-12T22:16:48+00:00"
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
@ -2317,16 +2317,16 @@
}, },
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
"version": "1.9.1", "version": "1.9.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/schmittjoh/php-option.git", "url": "https://github.com/schmittjoh/php-option.git",
"reference": "dd3a383e599f49777d8b628dadbb90cae435b87e" "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dd3a383e599f49777d8b628dadbb90cae435b87e", "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820",
"reference": "dd3a383e599f49777d8b628dadbb90cae435b87e", "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2334,7 +2334,7 @@
}, },
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2", "bamarni/composer-bin-plugin": "^1.8.2",
"phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12" "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -2376,7 +2376,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/schmittjoh/php-option/issues", "issues": "https://github.com/schmittjoh/php-option/issues",
"source": "https://github.com/schmittjoh/php-option/tree/1.9.1" "source": "https://github.com/schmittjoh/php-option/tree/1.9.2"
}, },
"funding": [ "funding": [
{ {
@ -2388,7 +2388,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-25T19:38:58+00:00" "time": "2023-11-12T21:59:55+00:00"
}, },
{ {
"name": "psr/clock", "name": "psr/clock",
@ -5413,31 +5413,31 @@
}, },
{ {
"name": "vlucas/phpdotenv", "name": "vlucas/phpdotenv",
"version": "v5.5.0", "version": "v5.6.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/vlucas/phpdotenv.git", "url": "https://github.com/vlucas/phpdotenv.git",
"reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4",
"reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-pcre": "*", "ext-pcre": "*",
"graham-campbell/result-type": "^1.0.2", "graham-campbell/result-type": "^1.1.2",
"php": "^7.1.3 || ^8.0", "php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.8", "phpoption/phpoption": "^1.9.2",
"symfony/polyfill-ctype": "^1.23", "symfony/polyfill-ctype": "^1.24",
"symfony/polyfill-mbstring": "^1.23.1", "symfony/polyfill-mbstring": "^1.24",
"symfony/polyfill-php80": "^1.23.1" "symfony/polyfill-php80": "^1.24"
}, },
"require-dev": { "require-dev": {
"bamarni/composer-bin-plugin": "^1.4.1", "bamarni/composer-bin-plugin": "^1.8.2",
"ext-filter": "*", "ext-filter": "*",
"phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
}, },
"suggest": { "suggest": {
"ext-filter": "Required to use the boolean validator." "ext-filter": "Required to use the boolean validator."
@ -5449,7 +5449,7 @@
"forward-command": true "forward-command": true
}, },
"branch-alias": { "branch-alias": {
"dev-master": "5.5-dev" "dev-master": "5.6-dev"
} }
}, },
"autoload": { "autoload": {
@ -5481,7 +5481,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/vlucas/phpdotenv/issues", "issues": "https://github.com/vlucas/phpdotenv/issues",
"source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.0"
}, },
"funding": [ "funding": [
{ {
@ -5493,7 +5493,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-10-16T01:01:54+00:00" "time": "2023-11-12T22:43:29+00:00"
}, },
{ {
"name": "voku/portable-ascii", "name": "voku/portable-ascii",

Voir le fichier

@ -1,8 +1,8 @@
@extends('layouts.appAuth') @extends('layouts.appAuth')
@section('title', 'Log In')
@section('content') @section('content')
<body class="h-100">
<div class="authincation h-100"> <div class="authincation h-100">
<div class="container h-100"> <div class="container h-100">
<div class="row justify-content-center h-100 align-items-center"> <div class="row justify-content-center h-100 align-items-center">
@ -48,8 +48,7 @@
</div> </div>
</form> </form>
<div class="new-account mt-3"> <div class="new-account mt-3">
<p>Don't have an account? <a class="text-primary" <p>Don't have an account? <a class="text-primary" href="{{route('register')}}">Sign
href="{{route('register')}}">Sign
up</a></p> up</a></p>
</div> </div>
</div> </div>
@ -61,6 +60,4 @@
</div> </div>
</div> </div>
</body>
@endsection @endsection

Voir le fichier

@ -1,8 +1,8 @@
@extends('layouts.appAuth') @extends('layouts.appAuth')
@section('title', 'Registraion')
@section('content') @section('content')
<body class="h-100">
<div class="authincation h-100"> <div class="authincation h-100">
<div class="container h-100"> <div class="container h-100">
<div class="row justify-content-center h-100 align-items-center"> <div class="row justify-content-center h-100 align-items-center">
@ -16,35 +16,40 @@
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label><strong>Full Name</strong></label> <label><strong>Full Name</strong></label>
<input type="text" class="form-control" value="{{old('name')}}" name="name" id="name" placeholder="Enter your Full Name"> <input type="text" class="form-control" value="{{old('name')}}" name="name"
id="name" placeholder="Enter your Full Name">
@if($errors->has('name')) @if($errors->has('name'))
<small class="d-block text-danger">{{$errors->first('name')}}</small> <small class="d-block text-danger">{{$errors->first('name')}}</small>
@endif @endif
</div> </div>
<div class="form-group"> <div class="form-group">
<label><strong>Email</strong></label> <label><strong>Email</strong></label>
<input type="email" class="form-control" value="{{old('email')}}" name="email" id="email" placeholder="Enter Email Address"> <input type="email" class="form-control" value="{{old('email')}}" name="email"
id="email" placeholder="Enter Email Address">
@if($errors->has('email')) @if($errors->has('email'))
<small class="d-block text-danger">{{$errors->first('email')}}</small> <small class="d-block text-danger">{{$errors->first('email')}}</small>
@endif @endif
</div> </div>
<div class="form-group"> <div class="form-group">
<label><strong>Phone Number</strong></label> <label><strong>Phone Number</strong></label>
<input type="text" class="form-control" value="{{old('contact_en')}}" name="contact_en" id="contact_en" placeholder="Enter Contact No"> <input type="text" class="form-control" value="{{old('contact_en')}}"
name="contact_en" id="contact_en" placeholder="Enter Contact No">
@if($errors->has('contact_en')) @if($errors->has('contact_en'))
<small class="d-block text-danger">{{$errors->first('contact_en')}}</small> <small class="d-block text-danger">{{$errors->first('contact_en')}}</small>
@endif @endif
</div> </div>
<div class="form-group"> <div class="form-group">
<label><strong>Password</strong></label> <label><strong>Password</strong></label>
<input type="password" class="form-control" name="password" id="password" placeholder="Enter Password"> <input type="password" class="form-control" name="password" id="password"
placeholder="Enter Password">
@if($errors->has('password')) @if($errors->has('password'))
<small class="d-block text-danger">{{$errors->first('password')}}</small> <small class="d-block text-danger">{{$errors->first('password')}}</small>
@endif @endif
</div> </div>
<div class="form-group"> <div class="form-group">
<label><strong>Confirm Password</strong></label> <label><strong>Confirm Password</strong></label>
<input type="password" class="form-control" name="password_confirmation" id="password_confirmation" placeholder="Re-enter Password"> <input type="password" class="form-control" name="password_confirmation"
id="password_confirmation" placeholder="Re-enter Password">
</div> </div>
<div class="text-center mt-4"> <div class="text-center mt-4">
<button type="submit" class="btn btn-primary btn-block">Sign me up</button> <button type="submit" class="btn btn-primary btn-block">Sign me up</button>
@ -62,6 +67,5 @@
</div> </div>
</div> </div>
</div> </div>
</body>
@endsection @endsection

Voir le fichier

@ -1,12 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{str_replace('_','_', app()->getLocale())}}">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>Edumin - Bootstrap Admin Dashboard </title> <title>{{ENV('APP_NAME')}} | @yield('title')</title>
<!-- Favicon icon --> <!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="{{asset('public/images/favicon.png')}}"> <link rel="icon" type="image/png" sizes="16x16" href="{{asset('public/images/favicon.png')}}">
<link rel="stylesheet" href="{{asset('public/vendor/jqvmap/css/jqvmap.min.css')}}"> <link rel="stylesheet" href="{{asset('public/vendor/jqvmap/css/jqvmap.min.css')}}">
@ -17,12 +17,13 @@
</head> </head>
<body>
<!--********************************** <!--**********************************
Main wrapper start Main wrapper start
***********************************--> ***********************************-->
<div id="main-wrapper">
<!--********************************** <!--**********************************
Nav header start Nav header start
@ -58,8 +59,7 @@
</span> </span>
<div class="dropdown-menu p-0 m-0"> <div class="dropdown-menu p-0 m-0">
<form> <form>
<input class="form-control" type="search" placeholder="Search" <input class="form-control" type="search" placeholder="Search" aria-label="Search">
aria-label="Search">
</form> </form>
</div> </div>
</div> </div>
@ -162,8 +162,7 @@ class="ti-arrow-right"></i></a>
<a href="page-login.html" class="dropdown-item ai-icon"> <a href="page-login.html" class="dropdown-item ai-icon">
<svg id="icon-logout" xmlns="http://www.w3.org/2000/svg" width="18" height="18" <svg id="icon-logout" xmlns="http://www.w3.org/2000/svg" width="18" height="18"
viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out">
class="feather feather-log-out">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path> <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
<polyline points="16 17 21 12 16 7"></polyline> <polyline points="16 17 21 12 16 7"></polyline>
<line x1="21" y1="12" x2="9" y2="12"></line> <line x1="21" y1="12" x2="9" y2="12"></line>
@ -444,9 +443,6 @@ class="feather feather-log-out">
<!--********************************** <!--**********************************
Support ticket button end Support ticket button end
***********************************--> ***********************************-->
</div>
<!--********************************** <!--**********************************
Main wrapper end Main wrapper end
***********************************--> ***********************************-->
@ -477,6 +473,6 @@ class="feather feather-log-out">
<script src="{{asset('public/vendor/svganimation/svg.animation.js')}}"></script> <script src="{{asset('public/vendor/svganimation/svg.animation.js')}}"></script>
<script src="{{asset('js/styleSwitcher.js')}}"></script> <script src="{{asset('js/styleSwitcher.js')}}"></script>
</body>
</html> </html>

Voir le fichier

@ -1,86 +1,29 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{str_replace('_','_', app()->getLocale())}}" class="h-100">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>Edumin - Bootstrap Admin Dashboard </title> <title>{{ENV('APP_NAME')}} | @yield('title') </title>
<!-- Favicon icon --> <!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="{{asset('public/images/favicon.png')}}"> <link rel="icon" type="image/png" sizes="16x16" href="{{asset('public/images/favicon.png')}}">
<link rel="stylesheet" href="{{asset('public/vendor/jqvmap/css/jqvmap.min.css')}}"> <link href="{{asset('public/css/style.css')}}" rel="stylesheet">
<link rel="stylesheet" href="{{asset('public/vendor/chartist/css/chartist.min.css')}}">
<link rel="stylesheet" href="{{asset('public/vendor/bootstrap-select/dist/css/bootstrap-select.min.css')}}">
<link rel="stylesheet" href="{{asset('public/css/style.css')}}">
<link rel="stylesheet" href="{{asset('public/css/skin-2.css')}}">
</head> </head>
<body class="h-100">
<!--**********************************
Main wrapper start
***********************************-->
<div id="main-wrapper">
@yield('content') @yield('content')
<!--**********************************
Footer start
***********************************-->
<div class="footer">
<div class="copyright">
<p>Copyright © Designed &amp; Developed by <a href="../index.htm" target="_blank">DexignLab</a> 2020</p>
</div>
</div>
<!--**********************************
Footer end
***********************************-->
<!--**********************************
Support ticket button start
***********************************-->
<!--**********************************
Support ticket button end
***********************************-->
</div>
<!--**********************************
Main wrapper end
***********************************-->
<!--********************************** <!--**********************************
Scripts Scripts
***********************************--> ***********************************-->
<!-- Required vendors --> <!-- Required vendors -->
<script src="{{asset('public/vendor/global/global.min.js')}}"></script> <script src="{{asset('public/vendor/global/global.min.js')}}"></script>
<script src="{{asset('public/vendor/bootstrap-select/dist/js/bootstrap-select.min.js')}}"></script> <script src="{{asset('public/vendor/bootstrap-select/dist/js/bootstrap-select.min.js')}}"></script>
<script src="{{asset('public/js/custom.min.js')}}"></script>
<script src="{{asset('public/js/dlabnav-init.js')}}"></script> <script src="{{asset('public/js/dlabnav-init.js')}}"></script>
<!--endRemoveIf(production)-->
<!-- Chart ChartJS plugin files -->
<script src="{{asset('public/vendor/chart.js/Chart.bundle.min.js')}}"></script>
<!-- Chart piety plugin files -->
<script src="{{asset('public/vendor/peity/jquery.peity.min.js')}}"></script>
<!-- Chart sparkline plugin files -->
<script src="{{asset('public/vendor/jquery-sparkline/jquery.sparkline.min.js')}}"></script>
<!-- Demo scripts -->
<script src="{{asset('public/js/dashboard/dashboard-3.js')}}"></script>
<!-- Svganimation scripts -->
<script src="{{asset('public/vendor/svganimation/vivus.min.js')}}"></script>
<script src="{{asset('public/vendor/svganimation/svg.animation.js')}}"></script>
<script src="{{asset('js/styleSwitcher.js')}}"></script>
{{-- TOASTER --}} {{-- TOASTER --}}
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
@ -100,6 +43,6 @@
toastr.error("{{ Session::get('error') }}"); toastr.error("{{ Session::get('error') }}");
@endif @endif
</script> </script>
</body>
</html> </html>

Voir le fichier

@ -1,8 +1,8 @@
@extends('layouts.app') @extends('layouts.app')
@section('title', 'Dashboard')
@section('content') @section('content')
<div id="main-wrapper">
<body>
<!--********************************** <!--**********************************
Content body start Content body start
***********************************--> ***********************************-->
@ -530,9 +530,9 @@ class="la la-trash-o"></i></a>
</div> </div>
</div> </div>
</div> </div>
</div>
<!--********************************** <!--**********************************
Content body end Content body end
***********************************--> ***********************************-->
</body>
@endsection @endsection