diff --git a/app/Http/Controllers/Admin/Auth/AuthController.php b/app/Http/Controllers/Admin/Auth/AuthController.php new file mode 100644 index 0000000..3c0b1e6 --- /dev/null +++ b/app/Http/Controllers/Admin/Auth/AuthController.php @@ -0,0 +1,22 @@ +withRouting( @@ -15,7 +18,12 @@ return Application::configure(basePath: dirname(__DIR__)) health: '/up', ) ->withMiddleware(function (Middleware $middleware) { - // + $middleware->redirectGuestsTo(fn (Request $request) => route('auth.login.index')); + $middleware->redirectUsersTo(fn (Request $request) => route('admin.dashboard.index')); + $middleware->alias([ + 'admin' => AdminMiddleware::class, + ]); + }) ->withExceptions(function (Exceptions $exceptions) { // diff --git a/config/auth.php b/config/auth.php index 855118c..c80c8e0 100644 --- a/config/auth.php +++ b/config/auth.php @@ -25,9 +25,9 @@ return [ | | Next, you may define every authentication guard for your application. | Of course, a great default configuration has been defined for you - | which utilizes session storage plus the Eloquent user provider. + | which utilizes session storage plus the Eloquent userController provider. | - | All authentication guards have a user provider, which defines how the + | All authentication guards have a userController provider, which defines how the | users are actually retrieved out of your database or other storage | system used by the application. Typically, Eloquent is utilized. | @@ -51,11 +51,11 @@ return [ | User Providers |-------------------------------------------------------------------------- | - | All authentication guards have a user provider, which defines how the + | All authentication guards have a userController provider, which defines how the | users are actually retrieved out of your database or other storage | system used by the application. Typically, Eloquent is utilized. | - | If you have multiple user tables or models you may configure multiple + | If you have multiple userController tables or models you may configure multiple | providers to represent the model / table. These providers may then | be assigned to any extra authentication guards you have defined. | @@ -86,14 +86,14 @@ return [ | | These configuration options specify the behavior of Laravel's password | reset functionality, including the table utilized for token storage - | and the user provider that is invoked to actually retrieve users. + | and the userController provider that is invoked to actually retrieve users. | | The expiry time is the number of minutes that each reset token will be | considered valid. This security feature keeps tokens short-lived so | they have less time to be guessed. You may change this as needed. | - | The throttle setting is the number of seconds a user must wait before - | generating more password reset tokens. This prevents the user from + | The throttle setting is the number of seconds a userController must wait before + | generating more password reset tokens. This prevents the userController from | quickly generating a very large amount of password reset tokens. | */ diff --git a/config/models.php b/config/models.php index 9a6dff4..36f2791 100644 --- a/config/models.php +++ b/config/models.php @@ -353,23 +353,23 @@ return [ | How the relations should be named in your models. | | 'related' Use the related table as the relation name. - | (post.author --> user.id) - generates Post::user() and User::posts() + | (post.author --> userController.id) + generates Post::userController() and User::posts() | | 'foreign_key' Use the foreign key as the relation name. | This can help to provide more meaningful relationship names, and avoids naming conflicts | if you have more than one relationship between two tables. - | (post.author_id --> user.id) + | (post.author_id --> userController.id) | generates Post::author() and User::posts_where_author() - | (post.editor_id --> user.id) + | (post.editor_id --> userController.id) | generates Post::editor() and User::posts_where_editor() | ID suffixes can be omitted from foreign keys. - | (post.author --> user.id) - | (post.editor --> user.id) + | (post.author --> userController.id) + | (post.editor --> userController.id) | generates the same as above. | Where the foreign key matches the related table name, it behaves as per the 'related' strategy. - | (post.user_id --> user.id) - | generates Post::user() and User::posts() + | (post.user_id --> userController.id) + | generates Post::userController() and User::posts() */ 'relation_name_strategy' => 'related', @@ -486,7 +486,7 @@ return [ // 'except' => ['migrations'], // 'only' => ['users'], // // Table Specifics Bellow: - // 'user' => [ + // 'userController' => [ // // Don't use any default trait // 'use' => [], // ] diff --git a/database/backup/airline_agency (2).sql b/database/backup/airline_agency (2).sql index e9f0fcc..8d4c0af 100644 --- a/database/backup/airline_agency (2).sql +++ b/database/backup/airline_agency (2).sql @@ -141,9 +141,9 @@ CREATE TABLE IF NOT EXISTS `favorites` ( -- INSERT INTO `favorites` (`id`, `user_id`, `favoritable_type`, `favoritable_id`, `created_at`) VALUES -(1, 4, 'App\\Models\\Tour', 2, '2026-08-17 10:11:01'), -(2, 4, 'App\\Models\\Tour', 3, '2026-08-17 10:46:14'), -(3, 4, 'App\\Models\\Tour', 1, '2026-08-17 10:48:29'); +(1, 4, 'App\\Models\\TourController', 2, '2026-08-17 10:11:01'), +(2, 4, 'App\\Models\\TourController', 3, '2026-08-17 10:46:14'), +(3, 4, 'App\\Models\\TourController', 1, '2026-08-17 10:48:29'); -- -------------------------------------------------------- @@ -269,11 +269,11 @@ CREATE TABLE IF NOT EXISTS `reservations` ( -- INSERT INTO `reservations` (`id`, `user_id`, `reservable_id`, `reservable_type`, `price`, `status`, `created_at`, `updated_at`) VALUES -(1, 4, 2, 'App\\Models\\Tour', 4500000, 'pending', '2026-08-17 15:45:04', '2026-08-17 15:45:04'), -(2, 4, 2, 'App\\Models\\Tour', 4500000, 'pending', '2026-08-17 15:45:08', '2026-08-17 15:45:08'), -(3, 4, 2, 'App\\Models\\Tour', 4500000, 'pending', '2026-08-17 15:45:50', '2026-08-17 15:45:50'), -(4, 4, 2, 'App\\Models\\Tour', 4500000, 'pending', '2026-08-17 15:50:47', '2026-08-17 15:50:47'), -(5, 4, 2, 'App\\Models\\Flight', 12000000, 'pending', '2026-08-17 15:56:38', '2026-08-17 15:56:38'); +(1, 4, 2, 'App\\Models\\TourController', 4500000, 'pending', '2026-08-17 15:45:04', '2026-08-17 15:45:04'), +(2, 4, 2, 'App\\Models\\TourController', 4500000, 'pending', '2026-08-17 15:45:08', '2026-08-17 15:45:08'), +(3, 4, 2, 'App\\Models\\TourController', 4500000, 'pending', '2026-08-17 15:45:50', '2026-08-17 15:45:50'), +(4, 4, 2, 'App\\Models\\TourController', 4500000, 'pending', '2026-08-17 15:50:47', '2026-08-17 15:50:47'), +(5, 4, 2, 'App\\Models\\FlightController', 12000000, 'pending', '2026-08-17 15:56:38', '2026-08-17 15:56:38'); -- -------------------------------------------------------- diff --git a/lang/en/auth.php b/lang/en/auth.php index 6598e2c..42ef0cb 100644 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -8,7 +8,7 @@ return [ |-------------------------------------------------------------------------- | | The following language lines are used during authentication for various - | messages that we need to display to the user. You are free to modify + | messages that we need to display to the userController. You are free to modify | these language lines according to your application's requirements. | */ diff --git a/lang/en/passwords.php b/lang/en/passwords.php index fad3a7d..3e6bff5 100644 --- a/lang/en/passwords.php +++ b/lang/en/passwords.php @@ -17,6 +17,6 @@ return [ 'sent' => 'We have emailed your password reset link.', 'throttled' => 'Please wait before retrying.', 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that email address.", + 'userController' => "We can't find a userController with that email address.", ]; diff --git a/lang/fa/auth.php b/lang/fa/auth.php index 8897689..c169dbc 100644 --- a/lang/fa/auth.php +++ b/lang/fa/auth.php @@ -8,7 +8,7 @@ return [ |-------------------------------------------------------------------------- | | The following language lines are used during authentication for various - | messages that we need to display to the user. You are free to modify + | messages that we need to display to the userController. You are free to modify | these language lines according to your application's requirements. | */ diff --git a/lang/fa/passwords.php b/lang/fa/passwords.php index c8081d9..ba84a97 100644 --- a/lang/fa/passwords.php +++ b/lang/fa/passwords.php @@ -17,6 +17,6 @@ return [ 'sent' => 'ایمیلی جهت بازیابی رمزعبور برای شما ارسال شد', 'throttled' => 'لطفا اندکی صبر کنید و دوباره امتحان کنید', 'token' => 'مشخصه بازیابی رمزعبور شما صحیح نمی باشد', - 'user' => "کاربری با این اطلاعات وجود ندارد", + 'userController' => "کاربری با این اطلاعات وجود ندارد", ]; diff --git a/public/assets/js/owl-carousel.js b/public/assets/js/owl-carousel.js index 9aea355..41f6541 100644 --- a/public/assets/js/owl-carousel.js +++ b/public/assets/js/owl-carousel.js @@ -2720,7 +2720,7 @@ this._pages = []; /** - * All DOM elements of the user interface. + * All DOM elements of the userController interface. * @protected * @type {Object} */ @@ -2938,7 +2938,7 @@ }; /** - * Draws the user interface. + * Draws the userController interface. * @todo The option `dotsData` wont work. * @protected */ diff --git a/public/assets/js/smooth-scroll.js b/public/assets/js/smooth-scroll.js index dd61943..9ab10ce 100644 --- a/public/assets/js/smooth-scroll.js +++ b/public/assets/js/smooth-scroll.js @@ -84,7 +84,7 @@ }; /** - * Check to see if user prefers reduced motion + * Check to see if userController prefers reduced motion * @param {Object} settings Script settings */ var reduceMotion = function (settings) { @@ -389,7 +389,7 @@ smoothScroll.animateScroll = function (anchor, toggle, options) { // Local settings - var animateSettings = extend(settings || defaults, options || {}); // Merge user options with defaults + var animateSettings = extend(settings || defaults, options || {}); // Merge userController options with defaults // Selectors and variables var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; @@ -483,7 +483,7 @@ */ var clickHandler = function (event) { - // Don't run if the user prefers reduced motion + // Don't run if the userController prefers reduced motion if (reduceMotion(settings)) return; // Don't run if right-click or command/control + click @@ -586,7 +586,7 @@ smoothScroll.destroy(); // Selectors and variables - settings = extend(defaults, options || {}); // Merge user options with defaults + settings = extend(defaults, options || {}); // Merge userController options with defaults fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header headerHeight = getHeaderHeight(fixedHeader); @@ -623,4 +623,4 @@ return SmoothScroll; -}); \ No newline at end of file +}); diff --git a/public/assets/js/typeahead.js b/public/assets/js/typeahead.js index 34e24cf..c2a200c 100644 --- a/public/assets/js/typeahead.js +++ b/public/assets/js/typeahead.js @@ -120,8 +120,8 @@ } else { element = this.$menu.insertAfter(this.$element); this.hasSameParent = true; - } - + } + if (!this.hasSameParent) { // We cannot rely on the element position, need to position relative to the window element.css("position", "fixed"); @@ -143,7 +143,7 @@ if (this.options.fitToElement === true) { element.css("width", this.$element.outerWidth() + "px"); } - + this.shown = true; return this; }, @@ -168,7 +168,7 @@ var worker = $.proxy(function () { - // Bloodhound (since 0.11) needs three arguments. + // Bloodhound (since 0.11) needs three arguments. // Two of them are callback functions (sync and async) for local and remote data processing // see https://github.com/twitter/typeahead.js/blob/master/src/bloodhound/bloodhound.js#L132 if ($.isFunction(this.source) && this.source.length === 3) { @@ -489,7 +489,7 @@ this.keyPressed = false; if (this.options.showHintOnFocus && this.skipShowHintOnFocus !== true) { if(this.options.showHintOnFocus === "all") { - this.lookup(""); + this.lookup(""); } else { this.lookup(); } @@ -506,12 +506,12 @@ this.focused = false; this.keyPressed = false; } else if (this.mouseddown) { - // This is for IE that blurs the input when user clicks on scroll. + // This is for IE that blurs the input when userController clicks on scroll. // We set the focus back on the input and prevent the lookup to occur again this.skipShowHintOnFocus = true; this.$element.focus(); this.mouseddown = false; - } + } }, click: function (e) { diff --git a/public/uploads/users/1787033345.webp b/public/uploads/users/1787033345.webp new file mode 100644 index 0000000..3789d37 Binary files /dev/null and b/public/uploads/users/1787033345.webp differ diff --git a/public/uploads/users/1787033369.jpg b/public/uploads/users/1787033369.jpg new file mode 100644 index 0000000..1c2daa2 Binary files /dev/null and b/public/uploads/users/1787033369.jpg differ diff --git a/resources/views/admin/auth/login.blade.php b/resources/views/admin/auth/login.blade.php new file mode 100644 index 0000000..509206d --- /dev/null +++ b/resources/views/admin/auth/login.blade.php @@ -0,0 +1,3 @@ +
+ +
diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 509c120..5ce90b3 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -1,3 +1,21 @@ -
- -
+@extends('admin.layouts.app') + + +@section('title','داشبورد') + + +@section('content') + +
+ +
+ +

+ خوش آمدید به پنل مدیریت +

+ +
+ +
+ +@endsection diff --git a/resources/views/admin/layouts/app.blade.php b/resources/views/admin/layouts/app.blade.php index 4530ca4..cee42af 100644 --- a/resources/views/admin/layouts/app.blade.php +++ b/resources/views/admin/layouts/app.blade.php @@ -1,3 +1,50 @@ -
- + + + + + + + + + + + @yield('title', 'پنل مدیریت') + + + + + + + + + + +
+ + + @include('admin.layouts.sidebar') + + +
+ + + @include('admin.layouts.header') + + +
+ + @yield('content') + +
+ + @include('admin.layouts.footer') + +
+ +
+ + + + + diff --git a/resources/views/admin/layouts/footer.blade.php b/resources/views/admin/layouts/footer.blade.php new file mode 100644 index 0000000..719a70b --- /dev/null +++ b/resources/views/admin/layouts/footer.blade.php @@ -0,0 +1,7 @@ + diff --git a/resources/views/admin/layouts/header.blade.php b/resources/views/admin/layouts/header.blade.php new file mode 100644 index 0000000..3a2732b --- /dev/null +++ b/resources/views/admin/layouts/header.blade.php @@ -0,0 +1,26 @@ + diff --git a/resources/views/admin/layouts/sidebar.blade.php b/resources/views/admin/layouts/sidebar.blade.php new file mode 100644 index 0000000..6265634 --- /dev/null +++ b/resources/views/admin/layouts/sidebar.blade.php @@ -0,0 +1,64 @@ +
+ + +

+ پنل مدیریت +

+ + + + + +
diff --git a/routes/admin.php b/routes/admin.php index 50cce95..a63f45a 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -1,3 +1,81 @@ name('admin.')->group(function (){ + + Route::get('/' ,function (){ + return redirect()->route(''); + })->name('index'); + + Route::prefix('auth')->name('auth.')->controller(AuthController::class)->group(function (){ + Route::prefix('login')->name('login.')->middleware('guest:admin')->group(function (){ + Route::get('/','login')->name('index'); + Route::post('/','loginPost')->name('post'); + }); + Route::get('logout','logout')->middleware('auth:admin') + ->name('logout'); + }); + + Route::middleware('auth:admin')->group(function (){ + + Route::get('dashboard',[DashboardController::class ,'index'])->name('dashboard.index'); + + Route::prefix('tours')->name('tours.')->controller(TourController::class)->group(function (){ + Route::get('/','index')->name('index'); + + Route::prefix('{tour}')->group(function (){ + Route::get('show','show')->name('show'); + + Route::get('edit','edit')->name('edit'); + Route::put('update','update')->name('update'); + + Route::delete('destroy','destroy')->name('destroy'); + }); + }); + Route::prefix('flights')->name('flights.')->controller(FlightController::class)->group(function (){ + Route::get('/','index')->name('index'); + + Route::prefix('{flight}')->group(function (){ + Route::get('show','show')->name('show'); + + Route::get('edit','edit')->name('edit'); + Route::put('update','update')->name('update'); + + Route::delete('destroy','destroy')->name('destroy'); + }); + }); + + Route::prefix('users') + ->name('users.') + ->controller(UserController::class) + ->group(function (){ + + Route::get('/','index')->name('index'); + + Route::prefix('{user}')->group(function (){ + + Route::get('show','show')->name('show'); + + Route::get('edit','edit')->name('edit'); + + Route::put('update','update')->name('update'); + + Route::delete('destroy','destroy')->name('destroy'); + + }); + }); + }); +}); + + + + +