feat:implement database
This commit is contained in:
@@ -9,11 +9,11 @@ class RegisterController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
return view('auth.register');
|
||||
}
|
||||
|
||||
public function post()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+6
-5
@@ -9,10 +9,11 @@ namespace App\Models;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Foundation\Auth\User as Authenticated;
|
||||
|
||||
/**
|
||||
* Class User
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $first_name
|
||||
* @property string $last_name
|
||||
@@ -26,20 +27,20 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property string $username
|
||||
* @property string $password
|
||||
* @property string $password_confirmation
|
||||
* @property string $user_provience
|
||||
* @property string $user_Province
|
||||
* @property string $user_city
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Carbon $deleted
|
||||
*
|
||||
*
|
||||
* @property File|null $file
|
||||
* @property Collection|Booking[] $bookings
|
||||
* @property Collection|Comment[] $comments
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class User extends Model
|
||||
class User extends Authenticated
|
||||
{
|
||||
protected $table = 'users';
|
||||
|
||||
@@ -68,7 +69,7 @@ class User extends Model
|
||||
'username',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
'user_provience',
|
||||
'user_Province',
|
||||
'user_city',
|
||||
'status',
|
||||
'deleted'
|
||||
|
||||
+3
-1
@@ -3,6 +3,7 @@
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
@@ -14,7 +15,8 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware): void {
|
||||
//
|
||||
$middleware
|
||||
->redirectGuestsTo(fn(Request $request)=> route('auth.login.index'));
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
//
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ return [
|
||||
'providers' => [
|
||||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => env('AUTH_MODEL', User::class),
|
||||
'model' =>User::class
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
|
||||
@@ -0,0 +1,328 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 5.2.0
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- Host: 127.0.0.1:3306
|
||||
-- Generation Time: Aug 16, 2026 at 03:04 PM
|
||||
-- Server version: 8.0.31
|
||||
-- PHP Version: 8.0.26
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
START TRANSACTION;
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
--
|
||||
-- Database: `airline_agency`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `airlines`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `airlines`;
|
||||
CREATE TABLE IF NOT EXISTS `airlines` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(256) COLLATE utf32_persian_ci NOT NULL,
|
||||
`code` varchar(20) COLLATE utf32_persian_ci NOT NULL,
|
||||
`file_id` bigint UNSIGNED NOT NULL,
|
||||
`status` tinyint NOT NULL COMMENT '0: disable |1: enable',
|
||||
`created_at` timestamp NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `airports`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `airports`;
|
||||
CREATE TABLE IF NOT EXISTS `airports` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf32_persian_ci NOT NULL,
|
||||
`city` varchar(255) COLLATE utf32_persian_ci NOT NULL,
|
||||
`country` varchar(255) COLLATE utf32_persian_ci NOT NULL,
|
||||
`code` varchar(10) COLLATE utf32_persian_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `bookings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `bookings`;
|
||||
CREATE TABLE IF NOT EXISTS `bookings` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`user_id` bigint UNSIGNED NOT NULL,
|
||||
`flight_id` bigint UNSIGNED NOT NULL,
|
||||
`toure_date_id` bigint UNSIGNED NOT NULL,
|
||||
`adult_count` int UNSIGNED NOT NULL,
|
||||
`child_count` int UNSIGNED NOT NULL,
|
||||
`total_price` int UNSIGNED NOT NULL,
|
||||
`tracking_code` varchar(50) COLLATE utf32_persian_ci NOT NULL,
|
||||
`status` tinyint NOT NULL COMMENT '1: pending | 2: confirmed | 3: cancelled',
|
||||
`created_ar` timestamp NOT NULL,
|
||||
`updated_at` timestamp NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `bookings_fk1` (`flight_id`),
|
||||
KEY `bookings_fk2` (`toure_date_id`),
|
||||
KEY `bookings_fk3` (`user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `booking_passengers`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `booking_passengers`;
|
||||
CREATE TABLE IF NOT EXISTS `booking_passengers` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`booking_id` bigint UNSIGNED NOT NULL,
|
||||
`first_name` varchar(150) COLLATE utf32_persian_ci NOT NULL,
|
||||
`last_name` varchar(150) COLLATE utf32_persian_ci NOT NULL,
|
||||
`national_code` varchar(20) COLLATE utf32_persian_ci NOT NULL,
|
||||
`birth_date` date NOT NULL,
|
||||
`passenger_type` tinyint UNSIGNED NOT NULL COMMENT '0: adult | 1: child ',
|
||||
`created_ar` timestamp NOT NULL,
|
||||
`updated_at` timestamp NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `cities`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `cities`;
|
||||
CREATE TABLE IF NOT EXISTS `cities` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`province_id` bigint UNSIGNED NOT NULL,
|
||||
`name` varchar(255) COLLATE utf32_persian_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `cities_fk1` (`province_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `comments`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `comments`;
|
||||
CREATE TABLE IF NOT EXISTS `comments` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`user_id` bigint UNSIGNED NOT NULL,
|
||||
`comment` text COLLATE utf32_persian_ci NOT NULL,
|
||||
`status` tinyint UNSIGNED NOT NULL COMMENT '0: pending | 1: approved | 2: rejected',
|
||||
`created_at` timestamp NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `comments_fk1` (`user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `files`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `files`;
|
||||
CREATE TABLE IF NOT EXISTS `files` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf32_persian_ci NOT NULL,
|
||||
`extension` varchar(10) COLLATE utf32_persian_ci NOT NULL,
|
||||
`size` bigint UNSIGNED NOT NULL,
|
||||
`original_name` varchar(500) COLLATE utf32_persian_ci NOT NULL,
|
||||
`path` varchar(300) COLLATE utf32_persian_ci NOT NULL,
|
||||
`created_at` timestamp NOT NULL,
|
||||
`updated_at` timestamp NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `flights`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `flights`;
|
||||
CREATE TABLE IF NOT EXISTS `flights` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(256) CHARACTER SET utf32 COLLATE utf32_persian_ci NOT NULL,
|
||||
`file_id` bigint UNSIGNED DEFAULT NULL,
|
||||
`airline_id` bigint UNSIGNED NOT NULL,
|
||||
`flight_type` tinyint UNSIGNED NOT NULL COMMENT '0: departure | 1: return | 2: roundtrip',
|
||||
`departure_time` timestamp NOT NULL,
|
||||
`departure_airport_id` bigint UNSIGNED NOT NULL,
|
||||
`arrival_airport_id` bigint UNSIGNED NOT NULL,
|
||||
`price` decimal(10,0) NOT NULL,
|
||||
`summary` varchar(512) CHARACTER SET utf32 COLLATE utf32_persian_ci NOT NULL,
|
||||
`capacity` int NOT NULL,
|
||||
`description` varchar(512) CHARACTER SET utf32 COLLATE utf32_persian_ci NOT NULL,
|
||||
`status` tinyint NOT NULL COMMENT '0: disable | 1: enable',
|
||||
`created_at` timestamp NOT NULL,
|
||||
`updated_at` timestamp NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `flights_fk1` (`airline_id`),
|
||||
KEY `flights_fk2` (`file_id`),
|
||||
KEY `flights_fk3` (`arrival_airport_id`),
|
||||
KEY `flights_fk4` (`departure_airport_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `provinces`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `provinces`;
|
||||
CREATE TABLE IF NOT EXISTS `provinces` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) COLLATE utf32_persian_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `tours`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `tours`;
|
||||
CREATE TABLE IF NOT EXISTS `tours` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(256) COLLATE utf32_persian_ci NOT NULL,
|
||||
`summary` text COLLATE utf32_persian_ci NOT NULL,
|
||||
`description` text COLLATE utf32_persian_ci NOT NULL,
|
||||
`origin` varchar(200) COLLATE utf32_persian_ci NOT NULL,
|
||||
`destination` varchar(256) COLLATE utf32_persian_ci NOT NULL,
|
||||
`file_id` bigint UNSIGNED DEFAULT NULL,
|
||||
`duration` int UNSIGNED NOT NULL,
|
||||
`status` tinyint NOT NULL COMMENT '0: disable | 1: enable',
|
||||
`created_ar` timestamp NOT NULL,
|
||||
`updated_at` timestamp NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `tours_fk1` (`file_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `tour_dates`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `tour_dates`;
|
||||
CREATE TABLE IF NOT EXISTS `tour_dates` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`tour_id` bigint UNSIGNED NOT NULL,
|
||||
`departure_date` date NOT NULL,
|
||||
`return_date` date NOT NULL,
|
||||
`price` int UNSIGNED NOT NULL,
|
||||
`capacity` int UNSIGNED NOT NULL,
|
||||
`status` tinyint NOT NULL COMMENT '1: disable | 2:enable',
|
||||
`created_at` timestamp NOT NULL,
|
||||
`updated_at` timestamp NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `tours_dates_fk1` (`tour_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
CREATE TABLE IF NOT EXISTS `users` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`first_name` varchar(256) COLLATE utf32_persian_ci NOT NULL,
|
||||
`last_name` varchar(256) COLLATE utf32_persian_ci NOT NULL,
|
||||
`national_code` varchar(10) COLLATE utf32_persian_ci NOT NULL,
|
||||
`gender` tinyint UNSIGNED NOT NULL COMMENT '0:male | 1:female | 2:unknown',
|
||||
`marital_status` tinyint UNSIGNED NOT NULL COMMENT '0:single | 1:married | 2:separated',
|
||||
`spouse_name` varchar(256) COLLATE utf32_persian_ci DEFAULT NULL,
|
||||
`mobile` varchar(11) COLLATE utf32_persian_ci NOT NULL,
|
||||
`email` varchar(150) COLLATE utf32_persian_ci NOT NULL,
|
||||
`file_id` bigint UNSIGNED DEFAULT NULL,
|
||||
`username` varchar(200) COLLATE utf32_persian_ci NOT NULL,
|
||||
`password` varchar(250) COLLATE utf32_persian_ci NOT NULL,
|
||||
`provience_id` bigint UNSIGNED NOT NULL,
|
||||
`city_id` bigint UNSIGNED NOT NULL,
|
||||
`status` tinyint UNSIGNED NOT NULL COMMENT '0:disable | 1:pending | 2:enable',
|
||||
`created_at` timestamp NOT NULL,
|
||||
`updated_at` timestamp NOT NULL,
|
||||
`deleted` timestamp NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `user_image_fk1` (`file_id`),
|
||||
KEY `users_fk2` (`provience_id`),
|
||||
KEY `users_fk3` (`city_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_persian_ci;
|
||||
|
||||
--
|
||||
-- Constraints for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Constraints for table `bookings`
|
||||
--
|
||||
ALTER TABLE `bookings`
|
||||
ADD CONSTRAINT `bookings_fk1` FOREIGN KEY (`flight_id`) REFERENCES `flights` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||
ADD CONSTRAINT `bookings_fk2` FOREIGN KEY (`toure_date_id`) REFERENCES `tour_dates` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||
ADD CONSTRAINT `bookings_fk3` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
|
||||
--
|
||||
-- Constraints for table `cities`
|
||||
--
|
||||
ALTER TABLE `cities`
|
||||
ADD CONSTRAINT `cities_fk1` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
|
||||
--
|
||||
-- Constraints for table `comments`
|
||||
--
|
||||
ALTER TABLE `comments`
|
||||
ADD CONSTRAINT `comments_fk1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
|
||||
--
|
||||
-- Constraints for table `flights`
|
||||
--
|
||||
ALTER TABLE `flights`
|
||||
ADD CONSTRAINT `flights_fk1` FOREIGN KEY (`airline_id`) REFERENCES `airlines` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||
ADD CONSTRAINT `flights_fk2` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||
ADD CONSTRAINT `flights_fk3` FOREIGN KEY (`arrival_airport_id`) REFERENCES `airports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||
ADD CONSTRAINT `flights_fk4` FOREIGN KEY (`departure_airport_id`) REFERENCES `airports` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
|
||||
--
|
||||
-- Constraints for table `tours`
|
||||
--
|
||||
ALTER TABLE `tours`
|
||||
ADD CONSTRAINT `tours_fk1` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
|
||||
--
|
||||
-- Constraints for table `tour_dates`
|
||||
--
|
||||
ALTER TABLE `tour_dates`
|
||||
ADD CONSTRAINT `tours_dates_fk1` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
|
||||
--
|
||||
-- Constraints for table `users`
|
||||
--
|
||||
ALTER TABLE `users`
|
||||
ADD CONSTRAINT `user_image_fk1` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||
ADD CONSTRAINT `users_fk2` FOREIGN KEY (`provience_id`) REFERENCES `provinces` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||
ADD CONSTRAINT `users_fk3` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
COMMIT;
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
@@ -42,8 +42,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="account">
|
||||
<a href="#"><i class="far fa-sign-in"></i>وارد شدن</a>
|
||||
<a href="#"><i class="far fa-user-tie"></i>ثبت نام</a>
|
||||
<a href="{{ route('auth.login.index') }}"><i class="far fa-sign-in"></i>وارد شدن</a>
|
||||
<a href="{{ route('auth.register.index') }}"><i class="far fa-user-tie"></i>ثبت نام</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user