├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Console │ ├── Commands │ │ └── UpdateTable.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Exports │ └── LifeInsuranceExport.php ├── Helpers │ ├── FanAvaranRoleAssign.php │ ├── Fanavaran.php │ ├── Log.php │ └── TokenGenerator.php ├── Http │ ├── Controllers │ │ ├── Api │ │ │ ├── AuthController.php │ │ │ ├── LifeInsurancesController.php │ │ │ └── UserController.php │ │ └── Controller.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ ├── ValidateSignature.php │ │ └── VerifyCsrfToken.php │ ├── Requests │ │ ├── LifeInsuranceRequest.php │ │ ├── LifeMedicalInfoRequest.php │ │ ├── LoginRequest.php │ │ ├── SignupRequest.php │ │ ├── StoreUserRequest.php │ │ └── UpdateUserRequest.php │ └── Resources │ │ ├── Agencies.php │ │ ├── Answers.php │ │ ├── Colors.php │ │ ├── Companies.php │ │ ├── Fields.php │ │ ├── Jobs.php │ │ ├── LifeInsuranceResource.php │ │ ├── Provinces.php │ │ ├── Responses.php │ │ └── UserResource.php ├── Models │ ├── Agency.php │ ├── Answer.php │ ├── Color.php │ ├── Company.php │ ├── FanAvaranRole.php │ ├── Field.php │ ├── Job.php │ ├── LifeInsurance.php │ ├── Province.php │ ├── Response.php │ └── User.php ├── Notifications │ └── SendVerificationCode.php └── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── fanavaran.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php ├── snappy.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2022_12_17_060048_create_agencies_table.php │ ├── 2022_12_18_073743_create_fanavaran_roles_table.php │ ├── 2022_12_18_163726_create_colors_table.php │ ├── 2022_12_24_095228_create_provinces_table.php │ ├── 2022_12_24_095255_create_answers_table.php │ ├── 2022_12_24_095638_create_fields_table.php │ ├── 2022_12_24_110413_create_responses_table.php │ ├── 2022_12_24_111634_create_companies_table.php │ ├── 2023_01_04_145207_create_jobs_table.php │ └── 2023_01_08_170816_create_life_insurances_table.php └── seeders │ └── DatabaseSeeder.php ├── lang ├── en │ ├── auth.php │ ├── pagination.php │ ├── passwords.php │ └── validation.php └── fa │ ├── auth.php │ ├── fa.json │ ├── pagination.php │ ├── passwords.php │ ├── validation-inline.php │ └── validation.php ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── Form-pishnahad.html ├── favicon.ico ├── index.php ├── pdf-export-assets │ ├── css │ │ ├── app.css │ │ ├── bootstrap.min.css │ │ └── font-awesome.min.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ ├── iransans.eot │ │ ├── iransans.ttf │ │ └── iransans.woff │ └── images │ │ ├── apple.png │ │ ├── barcode.png │ │ ├── logo-left.png │ │ └── logo-right.png └── robots.txt ├── react-life-form ├── .env.example ├── .gitignore ├── index.html ├── package-lock.json ├── package.json ├── public │ └── vite.svg ├── src │ ├── Dashboard.jsx │ ├── assets │ │ └── react.svg │ ├── axios-client.js │ ├── components │ │ ├── DefaultLayout.jsx │ │ └── GuestLayout.jsx │ ├── context │ │ └── ContextProvider.jsx │ ├── index.css │ ├── jobs - Copy (2).json │ ├── jobs - Copy (3).json │ ├── jobs - Copy (4).json │ ├── jobs - Copy (5).json │ ├── jobs - Copy.json │ ├── jobs.json │ ├── main.jsx │ ├── reportWebVitals.jsx │ ├── router.jsx │ └── views │ │ ├── Lifes.jsx │ │ ├── Login.jsx │ │ ├── NotFound.jsx │ │ ├── Signup.jsx │ │ ├── UserForm.jsx │ │ ├── Users.jsx │ │ ├── form-0 │ │ ├── InsuranceInfo.jsx │ │ ├── JobInfo.jsx │ │ ├── MultiStepForm.css │ │ ├── MultiStepForm.jsx │ │ └── PersonalInfo.jsx │ │ ├── form-1 │ │ ├── LifeCompare.jsx │ │ ├── LifeCompareItem.jsx │ │ ├── lifeCompare.css │ │ └── lifeCompareItem.css │ │ ├── form-2 │ │ ├── LifeMedicalInfo.jsx │ │ ├── LifeMedicalInfoItem.jsx │ │ ├── lifeMedicalInfo.css │ │ └── lifeMedicalInfoItem.css │ │ └── form-3 │ │ ├── InsuranceTargetDetails.jsx │ │ ├── InsuranceTargetDetailsHeir.jsx │ │ ├── InsuranceTargetDetailsItem.jsx │ │ ├── insuranceTargetDetails.css │ │ └── insuranceTargetDetailsItem.css └── vite.config.js ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js └── views │ ├── pdf │ ├── form.blade.php │ └── index.blade.php │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── vite.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | LOG_DEPRECATIONS_CHANNEL=null 9 | LOG_LEVEL=debug 10 | 11 | DB_CONNECTION=mysql 12 | DB_HOST=127.0.0.1 13 | DB_PORT=3306 14 | DB_DATABASE=tikaval 15 | DB_USERNAME=root 16 | DB_PASSWORD= 17 | 18 | BROADCAST_DRIVER=log 19 | CACHE_DRIVER=file 20 | FILESYSTEM_DISK=local 21 | QUEUE_CONNECTION=sync 22 | SESSION_DRIVER=file 23 | SESSION_LIFETIME=120 24 | 25 | MEMCACHED_HOST=127.0.0.1 26 | 27 | REDIS_HOST=127.0.0.1 28 | REDIS_PASSWORD=null 29 | REDIS_PORT=6379 30 | 31 | MAIL_MAILER=smtp 32 | MAIL_HOST=mailhog 33 | MAIL_PORT=1025 34 | MAIL_USERNAME=null 35 | MAIL_PASSWORD=null 36 | MAIL_ENCRYPTION=null 37 | MAIL_FROM_ADDRESS="hello@example.com" 38 | MAIL_FROM_NAME="${APP_NAME}" 39 | 40 | AWS_ACCESS_KEY_ID= 41 | AWS_SECRET_ACCESS_KEY= 42 | AWS_DEFAULT_REGION=us-east-1 43 | AWS_BUCKET= 44 | AWS_USE_PATH_STYLE_ENDPOINT=false 45 | 46 | PUSHER_APP_ID= 47 | PUSHER_APP_KEY= 48 | PUSHER_APP_SECRET= 49 | PUSHER_HOST= 50 | PUSHER_PORT=443 51 | PUSHER_SCHEME=https 52 | PUSHER_APP_CLUSTER=mt1 53 | 54 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 55 | VITE_PUSHER_HOST="${PUSHER_HOST}" 56 | VITE_PUSHER_PORT="${PUSHER_PORT}" 57 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 58 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 59 | 60 | FANAVARAN_BASE_URL="https://apimanager.iraneit.com/BimeApiManager/" 61 | CORP_ID="2981" 62 | CONTRACT_ID="45" 63 | LOCATION="3903" 64 | FANAVARANSSL=true 65 | FANAVARAN_TIMEOUT="200" 66 | FANAVARAN_ENV="live" 67 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/build 3 | /public/hot 4 | /public/storage 5 | /storage/*.key 6 | /vendor 7 | .env 8 | .env.backup 9 | .env.production 10 | .phpunit.result.cache 11 | Homestead.json 12 | Homestead.yaml 13 | auth.json 14 | npm-debug.log 15 | yarn-error.log 16 | /.fleet 17 | /.idea 18 | /.vscode 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Laravel Logo

2 | 3 |

4 | Build Status 5 | Total Downloads 6 | Latest Stable Version 7 | License 8 |

9 | 10 | ## About Laravel 11 | 12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: 13 | 14 | - [Simple, fast routing engine](https://laravel.com/docs/routing). 15 | - [Powerful dependency injection container](https://laravel.com/docs/container). 16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. 17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). 18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations). 19 | - [Robust background job processing](https://laravel.com/docs/queues). 20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting). 21 | 22 | Laravel is accessible, powerful, and provides tools required for large, robust applications. 23 | 24 | ## Learning Laravel 25 | 26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. 27 | 28 | You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. 29 | 30 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. 31 | 32 | ## Laravel Sponsors 33 | 34 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell). 35 | 36 | ### Premium Partners 37 | 38 | - **[Vehikl](https://vehikl.com/)** 39 | - **[Tighten Co.](https://tighten.co)** 40 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** 41 | - **[64 Robots](https://64robots.com)** 42 | - **[Cubet Techno Labs](https://cubettech.com)** 43 | - **[Cyber-Duck](https://cyber-duck.co.uk)** 44 | - **[Many](https://www.many.co.uk)** 45 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)** 46 | - **[DevSquad](https://devsquad.com)** 47 | - **[Curotec](https://www.curotec.com/services/technologies/laravel/)** 48 | - **[OP.GG](https://op.gg)** 49 | - **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)** 50 | - **[Lendio](https://lendio.com)** 51 | 52 | ## Contributing 53 | 54 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). 55 | 56 | ## Code of Conduct 57 | 58 | In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). 59 | 60 | ## Security Vulnerabilities 61 | 62 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. 63 | 64 | ## License 65 | 66 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). 67 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('update:table')->weekly(); 19 | $schedule->command('update:table agenices')->weekly(); 20 | $schedule->command('update:table colors')->daily(); 21 | } 22 | 23 | /** 24 | * Register the commands for the application. 25 | * 26 | * @return void 27 | */ 28 | protected function commands() 29 | { 30 | $this->load(__DIR__.'/Commands'); 31 | 32 | require base_path('routes/console.php'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | , \Psr\Log\LogLevel::*> 14 | */ 15 | protected $levels = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the exception types that are not reported. 21 | * 22 | * @var array> 23 | */ 24 | protected $dontReport = [ 25 | // 26 | ]; 27 | 28 | /** 29 | * A list of the inputs that are never flashed to the session on validation exceptions. 30 | * 31 | * @var array 32 | */ 33 | protected $dontFlash = [ 34 | 'current_password', 35 | 'password', 36 | 'password_confirmation', 37 | ]; 38 | 39 | /** 40 | * Register the exception handling callbacks for the application. 41 | * 42 | * @return void 43 | */ 44 | public function register() 45 | { 46 | $this->reportable(function (Throwable $e) { 47 | // 48 | }); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Helpers/FanAvaranRoleAssign.php: -------------------------------------------------------------------------------- 1 | first(); 11 | if($roleResult) 12 | $role_id=$roleResult->fanavaran_id; 13 | else 14 | return 'نقش درست وارد نشده است.'; 15 | $body= ['NationalCode'=>$formdata['NationalCode'], 16 | 'BirthYear'=>$formdata['BirthYear'], 17 | 'BirthMonth'=>$formdata['BirthMonth'], 18 | 'BirthDay'=>$formdata['BirthDay'] 19 | ]; 20 | $result=fanAvaranCallApi('Api/BimeApi/v2.0/common/parties/inquiry-by-unique-identifier','get',['body'=>$body]); 21 | if($result['status']==200) { 22 | foreach ($result['data'] as $item) { 23 | if ($item['RoleId'] == $role_id) { 24 | return $item['Id']; 25 | } 26 | } 27 | } 28 | return $this->signInRole($formdata,$role); 29 | } 30 | 31 | private function signInRole($formdata,$role){ 32 | $route=''; 33 | switch($role){ 34 | case 'zinaf': 35 | $route='beneficiaries'; 36 | case 'bimehgozar': 37 | $route='customers'; 38 | case 'bimehshodeh': 39 | $route='insured-people'; 40 | case 'sayer': 41 | $route='other-people'; 42 | } 43 | return $this->sign_in_api($route,$formdata); 44 | } 45 | 46 | private function sign_in_api($route,$formdata){ 47 | return fanAvaranCallApi('Api/BimeApi/v2.0/common/'.$route,'post',['body'=>$formdata]); 48 | } 49 | public function fanAvaranSaveRoles(){ 50 | $result=fanAvaranCallApi('api/BimeApi/v2.0/common/code-list/person-role','get'); 51 | // dd($result); 52 | if($result['status']==200){ 53 | foreach ($result['data'] as $item){ 54 | $entity=new FanAvaranRole(); 55 | $entity->fanavaran_id=$item['Id']; 56 | $entity->caption=$item['Caption']; 57 | $entity->is_active=$item['IsActive']; 58 | $entity->slug=$this->getRoleSlug($item['Caption']); 59 | $entity->save(); 60 | } 61 | } 62 | } 63 | 64 | private function getRoleSlug($caption){ 65 | switch ($caption){ 66 | case 'بيمه گذار': 67 | return 'bimehgozar'; 68 | case 'بيمه شده': 69 | return 'bimehshodeh'; 70 | case 'ذينفع': 71 | return 'zinaf'; 72 | case 'کارشناس': 73 | return 'karshenas'; 74 | case 'ساير': 75 | return 'sayer'; 76 | case 'نماينده / شعبه': 77 | return 'BMGZR6'; 78 | case 'مرکز درماني': 79 | return 'BMGZR7'; 80 | case 'بانک ذينفع': 81 | return 'BMGZR8'; 82 | case 'دارائي': 83 | return 'BMGZR9'; 84 | case 'بازارياب': 85 | return 'BMGZR10'; 86 | case 'پرسنل شرکت بيمه': 87 | return 'BMGZR11'; 88 | case 'شرکت کمک رسان': 89 | return 'BMGZR12'; 90 | case 'وزارت بهداشت': 91 | return 'BMGZR13'; 92 | case 'بيمه مرکزي': 93 | return 'BMGZR14'; 94 | case 'شهرداري': 95 | return 'BMGZR15'; 96 | case 'بروکر': 97 | return 'BMGZR16'; 98 | case 'بيمه گر اتکايي': 99 | return 'BMGZR17'; 100 | case 'تامين اجتماعي': 101 | return 'BMGZR18'; 102 | } 103 | return 'default'; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /app/Helpers/Fanavaran.php: -------------------------------------------------------------------------------- 1 | generateLoginToken(); 18 | $headers = isset($args['headers']) ? array_merge($args['headers'], config('fanavaran.headers')) : config('fanavaran.headers'); 19 | $headers['authenticationToken'] = Cache::get('auth_token'); 20 | $options = isset($args['options']) ? array_merge($args['options'], config('fanavaran.options')) : config('fanavaran.options'); 21 | $body = isset($args['body']) ? $args['body'] : []; 22 | $response = Http::withHeaders($headers)->withOptions($options)->$method($baseUrl . $url, $body); 23 | $responseStatus = $response->status(); 24 | if ($responseStatus != 200) { 25 | fanAvaranLog('error', [ 26 | 'message' => $response, 27 | 'channel' => 'call_api' 28 | ]); 29 | if (fanAvaranCallApiErrorHandler($responseStatus)) 30 | fanAvaranCallApi($url, $method, $args); 31 | } 32 | return [ 33 | 'status' => $responseStatus, 34 | 'data' => $responseStatus == 200 ? $response->json() : null, 35 | 'message' => $response->reason() 36 | ]; 37 | } catch (Exception $e) { 38 | fanAvaranLog('error', [ 39 | 'error' => $e, 40 | 'message' => 'Error has been occurred in call api', 41 | 'channel' => 'call_api' 42 | ]); 43 | return false; 44 | } 45 | } 46 | 47 | /** 48 | * @param $statusCode 49 | * @return bool 50 | */ 51 | function fanAvaranCallApiErrorHandler($statusCode): bool 52 | { 53 | if (in_array($statusCode, [401, 403])) 54 | return (new \App\Helpers\TokenGenerator())->generateLoginToken(); 55 | return false; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/Helpers/Log.php: -------------------------------------------------------------------------------- 1 | null, 17 | 'message' => '', 18 | 'channel' => 'single' 19 | ]; 20 | $args = array_merge($default_args, $args); 21 | try { 22 | if ($type == 'error' && $args['error']) { 23 | Log::channel($args['channel']) 24 | ->$type($args['message'] . '! ----- error message = ' . $args['error']?->getMessage() . ' ----- line = ' . $args['error']?->getLine() . '----- file = ' . $args['error']?->getFile()); 25 | } else { 26 | Log::channel($args['channel']) 27 | ->$type($args['message']); 28 | } 29 | } catch (\Exception $e) { 30 | Log::channel('single') 31 | ->error('Log does not create!' . '! ----- error message = ' . $e?->getMessage() . ' ----- line = ' . $e?->getLine() . '----- file = ' . $e?->getFile()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Helpers/TokenGenerator.php: -------------------------------------------------------------------------------- 1 | authUrl = config('fanavaran.base_url') . 'api/EITAuthentication/GetAppToken'; 19 | $this->loginUrl = config('fanavaran.base_url') . '/api/EITAuthentication/Login'; 20 | if (config('fanavaran.env') != 'live') { 21 | $this->authHeaders = [ 22 | 'appname' => 'Sales', 23 | 'secret' => 'aA@12345' 24 | ]; 25 | $this->loginHeaders = [ 26 | 'userName' => 'KarUser', 27 | 'Password' => 'karzxc123', 28 | 'appToken' => Cache::get('app_token') ?? $this->generateAppToken() 29 | ]; 30 | } else { 31 | $this->authHeaders = [ 32 | 'appname' => 'CustomerClub', 33 | 'secret' => 'C@stomerCl@b123', 34 | 'CustomerClub' => '0' 35 | ]; 36 | $this->loginHeaders = [ 37 | 'userName' => 'ApiCustomerClubUser', 38 | 'Password' => 'C@st0merUser@123', 39 | 'appToken' => Cache::get('app_token') ?? $this->generateAppToken() 40 | ]; 41 | } 42 | } 43 | 44 | /** 45 | * Genereate app token for login and Store in app_token cache 46 | * 47 | * @return string appToken 48 | */ 49 | protected function generateAppToken(): string 50 | { 51 | for ($i = 0; $i < 3; $i++) { 52 | try { 53 | if((config('fanavaran.env') != 'live')){ 54 | $result = Http::withoutVerifying() 55 | ->withHeaders($this->authHeaders) 56 | ->withOptions(['verify' => false]) 57 | ->post($this->authUrl) 58 | ->headers(); 59 | }else{ 60 | $result = Http::withHeaders($this->authHeaders) 61 | ->post($this->authUrl) 62 | ->headers(); 63 | } 64 | Cache::forever('app_token', $result['appToken'][0]); 65 | return $result['appToken'][0]; 66 | } catch (\Exception $e) { 67 | fanAvaranLog('error', [ 68 | 'error' => $e, 69 | 'message' => 'App Token Token not created', 70 | 'channel' => 'token' 71 | ]); 72 | } 73 | } 74 | return ''; 75 | } 76 | 77 | /** 78 | * Genereate authentication token for API and Store in auth_token cache 79 | * 80 | * @return bool is it successful? 81 | */ 82 | public function generateLoginToken(): bool 83 | { 84 | for ($i = 0; $i < 3; $i++) { 85 | try { 86 | if((config('fanavaran.env') != 'live')){ 87 | $result = Http::withoutVerifying() 88 | ->withHeaders($this->loginHeaders) 89 | ->withOptions(['verify' => false]) 90 | ->post($this->loginUrl) 91 | ->headers(); 92 | }else{ 93 | $result = Http::withHeaders($this->loginHeaders) 94 | ->post($this->loginUrl) 95 | ->headers(); 96 | } 97 | Cache::put('auth_token', $result['authenticationToken'][0], now()->addDay(1)); 98 | return true; 99 | } catch (\Exception $e) { 100 | fanAvaranLog('error', [ 101 | 'error' => $e, 102 | 'message' => 'Authentication Token not created', 103 | 'channel' => 'token' 104 | ]); 105 | $this->loginHeaders['appToken'] = $this->generateAppToken(); 106 | } 107 | } 108 | return false; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/AuthController.php: -------------------------------------------------------------------------------- 1 | validated(); 18 | /** @var \App\Models\User $user */ 19 | $user = User::create([ 20 | 'name' => $data['name'], 21 | 'email' => $data['email'], 22 | 'password' => bcrypt($data['password']), 23 | ]); 24 | 25 | $token = $user->createToken('main')->plainTextToken; 26 | return response(compact('user', 'token')); 27 | } 28 | 29 | public function login(LoginRequest $request) 30 | { 31 | $credentials = $request->validated(); 32 | if (!Auth::attempt($credentials)) { 33 | return response([ 34 | 'message' => 'Provided email or password is incorrect' 35 | ], 422); 36 | } 37 | 38 | /** @var \App\Models\User $user */ 39 | $user = Auth::user(); 40 | $token = $user->createToken('main')->plainTextToken; 41 | return response(compact('user', 'token')); 42 | } 43 | 44 | public function logout(Request $request) 45 | { 46 | /** @var \App\Models\User $user */ 47 | $user = $request->user(); 48 | $user->currentAccessToken()->delete(); 49 | return response('', 204); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/UserController.php: -------------------------------------------------------------------------------- 1 | orderBy('id', 'desc')->paginate(10)); 21 | } 22 | 23 | /** 24 | * Store a newly created resource in storage. 25 | * 26 | * @param \App\Http\Requests\StoreUserRequest $request 27 | * @return \Illuminate\Http\Response 28 | */ 29 | public function store(StoreUserRequest $request) 30 | { 31 | $data = $request->validated(); 32 | $data['password'] = bcrypt($data['password']); 33 | $user = User::create($data); 34 | 35 | return response(new UserResource($user) , 201); 36 | } 37 | 38 | /** 39 | * Display the specified resource. 40 | * 41 | * @param \App\Models\User $user 42 | * @return \Illuminate\Http\Response 43 | */ 44 | public function show(User $user) 45 | { 46 | return new UserResource($user); 47 | } 48 | 49 | /** 50 | * Update the specified resource in storage. 51 | * 52 | * @param \App\Http\Requests\UpdateUserRequest $request 53 | * @param \App\Models\User $user 54 | * @return \Illuminate\Http\Response 55 | */ 56 | public function update(UpdateUserRequest $request, User $user) 57 | { 58 | $data = $request->validated(); 59 | if (isset($data['password'])) { 60 | $data['password'] = bcrypt($data['password']); 61 | } 62 | $user->update($data); 63 | 64 | return new UserResource($user); 65 | } 66 | 67 | /** 68 | * Remove the specified resource from storage. 69 | * 70 | * @param \App\Models\User $user 71 | * @return \Illuminate\Http\Response 72 | */ 73 | public function destroy(User $user) 74 | { 75 | $user->delete(); 76 | 77 | return response("", 204); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array> 30 | */ 31 | protected $middlewareGroups = [ 32 | 'web' => [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | ], 40 | 41 | 'api' => [ 42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 43 | 'throttle:api', 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's route middleware. 50 | * 51 | * These middleware may be assigned to groups or used individually. 52 | * 53 | * @var array 54 | */ 55 | protected $routeMiddleware = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 63 | 'signed' => \App\Http\Middleware\ValidateSignature::class, 64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 66 | ]; 67 | } 68 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 26 | return redirect(RouteServiceProvider::HOME); 27 | } 28 | } 29 | 30 | return $next($request); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts() 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Middleware/ValidateSignature.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Requests/LifeInsuranceRequest.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | public function rules() 27 | { 28 | $now = Verta::now(); 29 | $max_age = (Verta::now())->subYears(65); 30 | return [ 31 | 'insurance_target' => [ 32 | 'required', 33 | Rule::in(["خودم", "همسر", "فرزند", "پدر", "مادر", "خواهر", "برادر"]), 34 | ], 35 | 'birth_year' => [ 36 | 'required', 37 | 'integer', 38 | 'between:' . $max_age->year . ',' . $now->year . '' 39 | ], 40 | 'birth_month' => [ 41 | 'required', 42 | 'integer', 43 | 'between:1,12' 44 | ], 45 | 'birth_day' => [ 46 | 'required', 47 | 'integer', 48 | 'between:1,31' 49 | ], 50 | 'life_ins_duration' => [ 51 | 'required', 52 | 'integer', 53 | 'between:5,30' 54 | ], 55 | 'payment_method' => [ 56 | 'required', 57 | Rule::in(["1", "2", "4", "12"]), 58 | ], 59 | 'annual_payment' => 'required|integer', 60 | 'first_job_level' => 'required', 61 | 'first_job_level_id' => 'required', 62 | 'second_job_level' => 'required', 63 | 'second_job_level_id' => 'required', 64 | 'divided_payment' => 'required|integer', 65 | 'annual_payment_increase' => 'required', 66 | 'addon_payment_method' => [ 67 | 'required', 68 | Rule::in(["1", "2"]), 69 | ], 70 | 'death_capital_any_reason_ratio' => 'required', 71 | 'capital_increase' => 'required', 72 | 'death_capital_incident_ratio' => '', 73 | 'maim_ratio' => '', 74 | 'has_medical_cost' => '', 75 | 'additional_dangers' => '', 76 | 'hospitalization' => '', 77 | 'exemption' => '', 78 | 'special_diseases_ratio' => '', 79 | ]; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/Http/Requests/LifeMedicalInfoRequest.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | public function rules() 27 | { 28 | return [ 29 | 'id' => 'required', 30 | 'national_code' => [ 31 | 'required', 32 | 'string', 33 | Rule::unique(LifeInsurance::class) 34 | ], 35 | // 'birth' => 'required', 36 | 'mobile_number' => 'required|string', 37 | 'ins_target_height' => 'required|integer', 38 | 'ins_target_weight' => 'required|integer', 39 | 'gender' => 'required|string', 40 | 'military_service_status' => '', 41 | 'military_service_details' => '', 42 | 'military_service_reason' => '', 43 | 'father_life_status' => 'required', 44 | 'father_age' => 'required|integer', 45 | 'father_death_reason' => '', 46 | 'mother_life_status' => 'required', 47 | 'mother_age' => 'required|integer', 48 | 'mother_death_reason' => '', 49 | 'family_health_history' => 'required', 50 | 'family_health_history_reason' => '', 51 | 'smoking_status' => 'required', 52 | 'hospitalization_status' => 'required', 53 | 'hospitalization_reason' => '', 54 | 'physical_impairment' => '', 55 | 'drug_usage' => '', 56 | 'health_status' => 'required', 57 | 'disease_type' => '', 58 | 'weight_loss' => 'required', 59 | 'weight_loss_reason' => '', 60 | 'verification_code' => 'required', 61 | ]; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/Http/Requests/LoginRequest.php: -------------------------------------------------------------------------------- 1 | 23 | */ 24 | public function rules() 25 | { 26 | return [ 27 | 'email' => 'required|email|string|exists:users,email', 28 | 'password' => [ 29 | 'required', 30 | ], 31 | 'remember' => 'boolean' 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Requests/SignupRequest.php: -------------------------------------------------------------------------------- 1 | 24 | */ 25 | public function rules() 26 | { 27 | return [ 28 | 'name' => ['required', 'string'], 29 | 'email' => ['required', 'email', 'unique:users,email'], 30 | 'password' => [ 31 | 'required', 32 | 'confirmed', 33 | Password::min(8) 34 | ->letters() 35 | ->symbols() 36 | ->numbers() 37 | ] 38 | ]; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreUserRequest.php: -------------------------------------------------------------------------------- 1 | 24 | */ 25 | public function rules() 26 | { 27 | return [ 28 | 'name' => 'required|string|max:55', 29 | 'email' => 'required|email|unique:users,email', 30 | 'password' => [ 31 | 'required', 32 | Password::min(8) 33 | ->letters() 34 | ->symbols(), 35 | ] 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateUserRequest.php: -------------------------------------------------------------------------------- 1 | 24 | */ 25 | public function rules() 26 | { 27 | return [ 28 | 'name' => 'required|string|max:55', 29 | 'email' => 'required|email|unique:users,email,'.$this->id, 30 | 'password' => [ 31 | 'confirmed', 32 | Password::min(8) 33 | ->letters() 34 | ->symbols(), 35 | ] 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Resources/Agencies.php: -------------------------------------------------------------------------------- 1 | = 10000 || !in_array($request['UnitKindId'], [201, 202, 203, 204, 207])) { 18 | return null; 19 | } 20 | return [ 21 | 'fanavaran_id' => $request['Code'], 22 | 'code' => $request['Code'], 23 | 'name' => $request['Name'], 24 | 'last_name' => $request['LastName'], 25 | 'national_code' => $request['NationalCode'], 26 | 'tel' => $request['Tel'], 27 | 'mobile' => $request['Mobile'], 28 | 'province_id' => $request['ProvinceId'], 29 | 'city_id' => $request['CityId'], 30 | 'address' => $request['Address'], 31 | 'unit_name' => $request['UnitName'], 32 | 'unit_kind_id' => $request['UnitKindId'], 33 | 'is_active' => $request['IsActive'], 34 | ]; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Http/Resources/Answers.php: -------------------------------------------------------------------------------- 1 | $request['Id'], 19 | 'caption' => $request['Caption'], 20 | 'is_active' => $request['IsActive'], 21 | ]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Http/Resources/Colors.php: -------------------------------------------------------------------------------- 1 | $request['Id'], 19 | 'name' => $request['Name'], 20 | 'caption' => $request['Caption'], 21 | 'is_active' => $request['IsActive'], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Resources/Companies.php: -------------------------------------------------------------------------------- 1 | $request['Id'], 19 | 'caption' => $request['Caption'], 20 | 'is_active' => $request['IsActive'], 21 | ]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Http/Resources/Fields.php: -------------------------------------------------------------------------------- 1 | $request['Id'], 19 | 'name' => $request['Name'], 20 | 'caption' => $request['Caption'], 21 | 'is_active' => $request['IsActive'], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Resources/Jobs.php: -------------------------------------------------------------------------------- 1 | $request['Id'], 19 | 'caption' => $request['Caption'], 20 | 'job_category_id' => $request['JobCategoryId'], 21 | 'is_active' => $request['IsActive'], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Resources/LifeInsuranceResource.php: -------------------------------------------------------------------------------- 1 | $this->insurance_target, 21 | 'birth_year' => $this->birth_year, 22 | 'birth_month' => $this->birth_month, 23 | 'birth_day' => $this->birth_day, 24 | 'life_ins_duration' => $this->life_ins_duration, 25 | 'payment_method' => $this->payment_method, 26 | 'annual_payment' => $this->annual_payment, 27 | 'first_job_level' => $this->first_job_level, 28 | 'first_job_level_id' => $this->first_job_level_id, 29 | 'second_job_level' => $this->second_job_level, 30 | 'second_job_level_id' => $this->second_job_level_id, 31 | 'divided_payment' => $this->divided_payment, 32 | 'annual_payment_increase' => $this->annual_payment_increase, 33 | 'addon_payment_method' => $this->addon_payment_method, 34 | 'death_capital_any_reason_ratio' => $this->death_capital_any_reason_ratio, 35 | 'capital_increase' => $this->capital_increase, 36 | 'death_capital_incident_ratio' => $this->death_capital_incident_ratio, 37 | 'maim_ratio' => $this->maim_ratio, 38 | 'has_medical_cost' => $this->has_medical_cost, 39 | 'additional_dangers' => $this->additional_dangers, 40 | 'hospitalization' => $this->hospitalization, 41 | 'exemption' => $this->exemption, 42 | 'special_diseases_ratio' => $this->special_diseases_ratio, 43 | 'national_code' => $this->national_code, 44 | 'mobile_number' => $this->mobile_number, 45 | 'ins_target_height' => $this->ins_target_height, 46 | 'ins_target_weight' => $this->ins_target_weight, 47 | 'gender' => $this->gender, 48 | 'military_service_status' => $this->military_service_status, 49 | 'military_service_details' => $this->military_service_details, 50 | 'military_service_reason' => $this->military_service_reason, 51 | 'father_life_status' => $this->father_life_status, 52 | 'father_age' => $this->father_age, 53 | 'father_death_reason' => $this->father_death_reason, 54 | 'mother_life_status' => $this->mother_life_status, 55 | 'mother_age' => $this->mother_age, 56 | 'mother_death_reason' => $this->mother_death_reason, 57 | 'family_health_history' => $this->family_health_history, 58 | 'family_health_history_reason' => $this->family_health_history_reason, 59 | 'smoking_status' => $this->smoking_status, 60 | 'hospitalization_status' => $this->hospitalization_status, 61 | 'hospitalization_reason' => $this->hospitalization_reason, 62 | 'physical_impairment' => $this->physical_impairment, 63 | 'drug_usage' => $this->drug_usage, 64 | 'health_status' => $this->health_status, 65 | 'disease_type' => $this->disease_type, 66 | 'weight_loss' => $this->weight_loss, 67 | 'weight_loss_reason' => $this->weight_loss_reason, 68 | 'cretaed_at' => $this->created_at, 69 | 'updated_at' => $this->updated_at, 70 | ]; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/Http/Resources/Provinces.php: -------------------------------------------------------------------------------- 1 | $request['Id'], 19 | 'name' => $request['Name'], 20 | 'caption' => $request['Caption'], 21 | 'is_active' => $request['IsActive'], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Resources/Responses.php: -------------------------------------------------------------------------------- 1 | $request['Id'], 19 | 'caption' => $request['Caption'], 20 | 'is_active' => $request['IsActive'], 21 | ]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Http/Resources/UserResource.php: -------------------------------------------------------------------------------- 1 | $this->id, 21 | 'name' => $this->name, 22 | 'email' => $this->email, 23 | 'created_at' => $this->created_at->format('Y-m-d H:i:s'), 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Models/Agency.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | protected $hidden = [ 20 | 'id', 21 | 'created_at', 22 | 'updated_at', 23 | ]; 24 | } 25 | -------------------------------------------------------------------------------- /app/Models/Answer.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | protected $hidden = [ 20 | 'id', 21 | 'created_at', 22 | 'updated_at', 23 | ]; 24 | } 25 | -------------------------------------------------------------------------------- /app/Models/Company.php: -------------------------------------------------------------------------------- 1 | 'int', 25 | 'divided_payment' => 'int', 26 | 'created_at' => 'datetime', 27 | 'updated_at' => 'datetime', 28 | ]; 29 | // public function annualPayment(): Attribute 30 | // { 31 | // return new Attribute( 32 | // get: fn($value) => (int) $value, 33 | // ); 34 | // } 35 | // public function dividedPayment(): Attribute 36 | // { 37 | // return new Attribute( 38 | // get: fn($value) => (int) $value, 39 | // ); 40 | // } 41 | public function createdAt(): Attribute 42 | { 43 | return new Attribute( 44 | get: fn($value) => (new Carbon($value))->diffForHumans(), 45 | ); 46 | } 47 | public function updatedAt(): Attribute 48 | { 49 | return new Attribute( 50 | get: fn($value) => (new Carbon($value))->diffForHumans(), 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Models/Province.php: -------------------------------------------------------------------------------- 1 | 19 | */ 20 | protected $fillable = [ 21 | 'name', 22 | 'email', 23 | 'password', 24 | ]; 25 | 26 | /** 27 | * The attributes that should be hidden for serialization. 28 | * 29 | * @var array 30 | */ 31 | protected $hidden = [ 32 | 'password', 33 | 'remember_token', 34 | ]; 35 | 36 | /** 37 | * The attributes that should be cast. 38 | * 39 | * @var array 40 | */ 41 | protected $casts = [ 42 | 'email_verified_at' => 'datetime', 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /app/Notifications/SendVerificationCode.php: -------------------------------------------------------------------------------- 1 | subject(" کد تایید ---{$this->user->email}---") 45 | ->greeting("کد تایید شما : ") 46 | ->line($this->verification_code) 47 | ->action('برگشت به سایت', url('/')) 48 | ->line('با تشکر از انتخاب شما !'); 49 | } 50 | 51 | /** 52 | * Get the array representation of the notification. 53 | * 54 | * @param mixed $notifiable 55 | * @return array 56 | */ 57 | public function toArray($notifiable) 58 | { 59 | return [ 60 | // 61 | ]; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | // 31 | } 32 | 33 | /** 34 | * Determine if events and listeners should be automatically discovered. 35 | * 36 | * @return bool 37 | */ 38 | public function shouldDiscoverEvents() 39 | { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 30 | 31 | $this->routes(function () { 32 | Route::middleware('api') 33 | ->prefix('api') 34 | ->group(base_path('routes/api.php')); 35 | 36 | Route::middleware('web') 37 | ->group(base_path('routes/web.php')); 38 | }); 39 | } 40 | 41 | /** 42 | * Configure the rate limiters for the application. 43 | * 44 | * @return void 45 | */ 46 | protected function configureRateLimiting() 47 | { 48 | RateLimiter::for('api', function (Request $request) { 49 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": ["framework", "laravel"], 6 | "license": "MIT", 7 | "require": { 8 | "php": "^8.0.2", 9 | "barryvdh/laravel-snappy": "^1.0", 10 | "guzzlehttp/guzzle": "^7.2", 11 | "hekmatinasser/verta": "^8.1", 12 | "laravel/framework": "^9.19", 13 | "laravel/sanctum": "^3.0", 14 | "laravel/tinker": "^2.7", 15 | "maatwebsite/excel": "^3.1" 16 | }, 17 | "require-dev": { 18 | "fakerphp/faker": "^1.9.1", 19 | "laravel/pint": "^1.0", 20 | "laravel/sail": "^1.0.1", 21 | "mockery/mockery": "^1.4.4", 22 | "nunomaduro/collision": "^6.1", 23 | "phpunit/phpunit": "^9.5.10", 24 | "spatie/laravel-ignition": "^1.0" 25 | }, 26 | "autoload": { 27 | "files": [ 28 | "app/Helpers/Fanavaran.php", 29 | "app/Helpers/Log.php" 30 | ], 31 | "psr-4": { 32 | "App\\": "app/", 33 | "Database\\Factories\\": "database/factories/", 34 | "Database\\Seeders\\": "database/seeders/" 35 | } 36 | }, 37 | "autoload-dev": { 38 | "psr-4": { 39 | "Tests\\": "tests/" 40 | } 41 | }, 42 | "scripts": { 43 | "post-autoload-dump": [ 44 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 45 | "@php artisan package:discover --ansi" 46 | ], 47 | "post-update-cmd": [ 48 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force" 49 | ], 50 | "post-root-package-install": [ 51 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 52 | ], 53 | "post-create-project-cmd": [ 54 | "@php artisan key:generate --ansi" 55 | ] 56 | }, 57 | "extra": { 58 | "laravel": { 59 | "dont-discover": [] 60 | } 61 | }, 62 | "config": { 63 | "optimize-autoloader": true, 64 | "preferred-install": "dist", 65 | "sort-packages": true, 66 | "allow-plugins": { 67 | "pestphp/pest-plugin": true 68 | } 69 | }, 70 | "minimum-stability": "dev", 71 | "prefer-stable": true 72 | } 73 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | ], 44 | 45 | /* 46 | |-------------------------------------------------------------------------- 47 | | User Providers 48 | |-------------------------------------------------------------------------- 49 | | 50 | | All authentication drivers have a user provider. This defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | mechanisms used by this application to persist your user's data. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | sources which represent each model / table. These sources may then 56 | | be assigned to any extra authentication guards you have defined. 57 | | 58 | | Supported: "database", "eloquent" 59 | | 60 | */ 61 | 62 | 'providers' => [ 63 | 'users' => [ 64 | 'driver' => 'eloquent', 65 | 'model' => App\Models\User::class, 66 | ], 67 | 68 | // 'users' => [ 69 | // 'driver' => 'database', 70 | // 'table' => 'users', 71 | // ], 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Resetting Passwords 77 | |-------------------------------------------------------------------------- 78 | | 79 | | You may specify multiple password reset configurations if you have more 80 | | than one user table or model in the application and you want to have 81 | | separate password reset settings based on the specific user types. 82 | | 83 | | The expire time is the number of minutes that each reset token will be 84 | | considered valid. This security feature keeps tokens short-lived so 85 | | they have less time to be guessed. You may change this as needed. 86 | | 87 | */ 88 | 89 | 'passwords' => [ 90 | 'users' => [ 91 | 'provider' => 'users', 92 | 'table' => 'password_resets', 93 | 'expire' => 60, 94 | 'throttle' => 60, 95 | ], 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Password Confirmation Timeout 101 | |-------------------------------------------------------------------------- 102 | | 103 | | Here you may define the amount of seconds before a password confirmation 104 | | times out and the user is prompted to re-enter their password via the 105 | | confirmation screen. By default, the timeout lasts for three hours. 106 | | 107 | */ 108 | 109 | 'password_timeout' => 10800, 110 | 111 | ]; 112 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 40 | 'port' => env('PUSHER_PORT', 443), 41 | 'scheme' => env('PUSHER_SCHEME', 'https'), 42 | 'encrypted' => true, 43 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', 44 | ], 45 | 'client_options' => [ 46 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 47 | ], 48 | ], 49 | 50 | 'ably' => [ 51 | 'driver' => 'ably', 52 | 'key' => env('ABLY_KEY'), 53 | ], 54 | 55 | 'redis' => [ 56 | 'driver' => 'redis', 57 | 'connection' => 'default', 58 | ], 59 | 60 | 'log' => [ 61 | 'driver' => 'log', 62 | ], 63 | 64 | 'null' => [ 65 | 'driver' => 'null', 66 | ], 67 | 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "apc", "array", "database", "file", 30 | | "memcached", "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | ], 56 | 57 | 'memcached' => [ 58 | 'driver' => 'memcached', 59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 60 | 'sasl' => [ 61 | env('MEMCACHED_USERNAME'), 62 | env('MEMCACHED_PASSWORD'), 63 | ], 64 | 'options' => [ 65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 66 | ], 67 | 'servers' => [ 68 | [ 69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 70 | 'port' => env('MEMCACHED_PORT', 11211), 71 | 'weight' => 100, 72 | ], 73 | ], 74 | ], 75 | 76 | 'redis' => [ 77 | 'driver' => 'redis', 78 | 'connection' => 'cache', 79 | 'lock_connection' => 'default', 80 | ], 81 | 82 | 'dynamodb' => [ 83 | 'driver' => 'dynamodb', 84 | 'key' => env('AWS_ACCESS_KEY_ID'), 85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 88 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 89 | ], 90 | 91 | 'octane' => [ 92 | 'driver' => 'octane', 93 | ], 94 | 95 | ], 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Cache Key Prefix 100 | |-------------------------------------------------------------------------- 101 | | 102 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache 103 | | stores there might be other applications using the same cache. For 104 | | that reason, you may prefix every cache key to avoid collisions. 105 | | 106 | */ 107 | 108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/fanavaran.php: -------------------------------------------------------------------------------- 1 | env('FANAVARAN_BASE_URL', 'https://bime.net.iraneit.com:3023/BimeApiManager_Release/'), 5 | 'env' => env('FANAVARAN_ENV', 'demo'), 6 | 'headers' => $header = [ 7 | 'CorpId' => env('CORP_ID', '1393'), 8 | 'ContractId' => env('CONTRACT_ID', '2'), 9 | 'Content-Type' => 'application/json', 10 | 'Location' => env('LOCATION', '1') 11 | ], 12 | 'options' => [ 13 | 'verify' => env('FANAVARANSSL', false), 14 | 'timeout' => env('FANAVARAN_TIMEOUT', '60'), 15 | ], 16 | ]; 17 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been set up for each driver as an example of the required values. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | 'throw' => false, 37 | ], 38 | 39 | 'public' => [ 40 | 'driver' => 'local', 41 | 'root' => storage_path('app/public'), 42 | 'url' => env('APP_URL').'/storage', 43 | 'visibility' => 'public', 44 | 'throw' => false, 45 | ], 46 | 47 | 's3' => [ 48 | 'driver' => 's3', 49 | 'key' => env('AWS_ACCESS_KEY_ID'), 50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 51 | 'region' => env('AWS_DEFAULT_REGION'), 52 | 'bucket' => env('AWS_BUCKET'), 53 | 'url' => env('AWS_URL'), 54 | 'endpoint' => env('AWS_ENDPOINT'), 55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 56 | 'throw' => false, 57 | ], 58 | 59 | ], 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Symbolic Links 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Here you may configure the symbolic links that will be created when the 67 | | `storage:link` Artisan command is executed. The array keys should be 68 | | the locations of the links and the values should be their targets. 69 | | 70 | */ 71 | 72 | 'links' => [ 73 | public_path('storage') => storage_path('app/public'), 74 | ], 75 | 76 | ]; 77 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 65536, 48 | 'threads' => 1, 49 | 'time' => 4, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array", "failover" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'local_domain' => env('MAIL_EHLO_DOMAIN'), 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | ], 59 | 60 | 'sendmail' => [ 61 | 'transport' => 'sendmail', 62 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 63 | ], 64 | 65 | 'log' => [ 66 | 'transport' => 'log', 67 | 'channel' => env('MAIL_LOG_CHANNEL'), 68 | ], 69 | 70 | 'array' => [ 71 | 'transport' => 'array', 72 | ], 73 | 74 | 'failover' => [ 75 | 'transport' => 'failover', 76 | 'mailers' => [ 77 | 'smtp', 78 | 'log', 79 | ], 80 | ], 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Global "From" Address 86 | |-------------------------------------------------------------------------- 87 | | 88 | | You may wish for all e-mails sent by your application to be sent from 89 | | the same address. Here, you may specify a name and address that is 90 | | used globally for all e-mails that are sent by your application. 91 | | 92 | */ 93 | 94 | 'from' => [ 95 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 96 | 'name' => env('MAIL_FROM_NAME', 'Example'), 97 | ], 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Markdown Mail Settings 102 | |-------------------------------------------------------------------------- 103 | | 104 | | If you are using Markdown based email rendering, you may configure your 105 | | theme and component paths here, allowing you to customize the design 106 | | of the emails. Or, you may simply stick with the Laravel defaults! 107 | | 108 | */ 109 | 110 | 'markdown' => [ 111 | 'theme' => 'default', 112 | 113 | 'paths' => [ 114 | resource_path('views/vendor/mail'), 115 | ], 116 | ], 117 | 118 | ]; 119 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | 'after_commit' => false, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 90, 50 | 'block_for' => 0, 51 | 'after_commit' => false, 52 | ], 53 | 54 | 'sqs' => [ 55 | 'driver' => 'sqs', 56 | 'key' => env('AWS_ACCESS_KEY_ID'), 57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 59 | 'queue' => env('SQS_QUEUE', 'default'), 60 | 'suffix' => env('SQS_SUFFIX'), 61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 62 | 'after_commit' => false, 63 | ], 64 | 65 | 'redis' => [ 66 | 'driver' => 'redis', 67 | 'connection' => 'default', 68 | 'queue' => env('REDIS_QUEUE', 'default'), 69 | 'retry_after' => 90, 70 | 'block_for' => null, 71 | 'after_commit' => false, 72 | ], 73 | 74 | ], 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Failed Queue Jobs 79 | |-------------------------------------------------------------------------- 80 | | 81 | | These options configure the behavior of failed queue job logging so you 82 | | can control which database and table are used to store the jobs that 83 | | have failed. You may change them to any database / table you wish. 84 | | 85 | */ 86 | 87 | 'failed' => [ 88 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 89 | 'database' => env('DB_CONNECTION', 'mysql'), 90 | 'table' => 'failed_jobs', 91 | ], 92 | 93 | ]; 94 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( 19 | '%s%s', 20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 21 | Sanctum::currentApplicationUrlWithPort() 22 | ))), 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Sanctum Guards 27 | |-------------------------------------------------------------------------- 28 | | 29 | | This array contains the authentication guards that will be checked when 30 | | Sanctum is trying to authenticate a request. If none of these guards 31 | | are able to authenticate the request, Sanctum will use the bearer 32 | | token that's present on an incoming request for authentication. 33 | | 34 | */ 35 | 36 | 'guard' => ['web'], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Expiration Minutes 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This value controls the number of minutes until an issued token will be 44 | | considered expired. If this value is null, personal access tokens do 45 | | not expire. This won't tweak the lifetime of first-party sessions. 46 | | 47 | */ 48 | 49 | 'expiration' => null, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Sanctum Middleware 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When authenticating your first-party SPA with Sanctum you may need to 57 | | customize some of the middleware Sanctum uses while processing the 58 | | request. You may change the middleware listed below as required. 59 | | 60 | */ 61 | 62 | 'middleware' => [ 63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/snappy.php: -------------------------------------------------------------------------------- 1 | [ 37 | 'enabled' => true, 38 | // 'binary' => env('WKHTML_PDF_BINARY', '/usr/local/bin/wkhtmltopdf'), 39 | 'binary' => '"C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf"', 40 | 'timeout' => false, 41 | 'options' => [ 42 | 'enable-local-file-access' => true, 43 | 'encoding' => 'UTF-8', 44 | // 'page-size' => 'A3', 45 | ], 46 | 'env' => [], 47 | ], 48 | 49 | 'image' => [ 50 | 'enabled' => true, 51 | // 'binary' => env('WKHTML_IMG_BINARY', '/usr/local/bin/wkhtmltoimage'), 52 | 'binary' => '"C:\Program Files\wkhtmltopdf\bin\wkhtmltoimage"', 53 | 'timeout' => false, 54 | 'options' => [], 55 | 'env' => [], 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class UserFactory extends Factory 12 | { 13 | /** 14 | * Define the model's default state. 15 | * 16 | * @return array 17 | */ 18 | public function definition() 19 | { 20 | return [ 21 | 'name' => fake()->name(), 22 | 'email' => fake()->unique()->safeEmail(), 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | } 28 | 29 | /** 30 | * Indicate that the model's email address should be unverified. 31 | * 32 | * @return static 33 | */ 34 | public function unverified() 35 | { 36 | return $this->state(fn (array $attributes) => [ 37 | 'email_verified_at' => null, 38 | ]); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->primary(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->morphs('tokenable'); 19 | $table->string('name'); 20 | $table->string('token', 64)->unique(); 21 | $table->text('abilities')->nullable(); 22 | $table->timestamp('last_used_at')->nullable(); 23 | $table->timestamp('expires_at')->nullable(); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('personal_access_tokens'); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /database/migrations/2022_12_17_060048_create_agencies_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->integer('fanavaran_id')->unique(); 19 | $table->integer('code')->nullable(); 20 | $table->string('name')->nullable(); 21 | $table->string('last_name')->nullable(); 22 | $table->string('national_code')->nullable(); 23 | $table->string('tel')->nullable(); 24 | $table->string('mobile')->nullable(); 25 | $table->integer('province_id')->nullable(); 26 | $table->integer('city_id')->nullable(); 27 | $table->string('address')->nullable(); 28 | $table->string('unit_name')->nullable(); 29 | $table->integer('unit_kind_id')->nullable(); 30 | $table->integer('is_active')->nullable(); 31 | $table->timestamps(); 32 | }); 33 | } 34 | /** 35 | * Reverse the migrations. 36 | * 37 | * @return void 38 | */ 39 | public function down() 40 | { 41 | Schema::dropIfExists('agencies'); 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /database/migrations/2022_12_18_073743_create_fanavaran_roles_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->integer('fanavaran_id')->unique(); 19 | $table->tinyInteger('is_active'); 20 | $table->string('caption'); 21 | $table->string('slug'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('fanavaran_roles'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2022_12_18_163726_create_colors_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->integer('fanavaran_id')->unique(); 19 | $table->string('name')->nullable(); 20 | $table->string('caption'); 21 | $table->integer('is_active'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('colors'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2022_12_24_095228_create_provinces_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('caption'); 19 | $table->integer('fanavaran_id')->unique(); 20 | $table->integer('is_active'); 21 | $table->string('name')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('provinces'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2022_12_24_095255_create_answers_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('caption'); 19 | $table->integer('fanavaran_id')->unique(); 20 | $table->integer('is_active'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('answers'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /database/migrations/2022_12_24_095638_create_fields_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('caption'); 19 | $table->integer('fanavaran_id')->unique(); 20 | $table->integer('is_active'); 21 | $table->string('name'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('fields'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2022_12_24_110413_create_responses_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('caption'); 19 | $table->integer('fanavaran_id')->unique(); 20 | $table->integer('is_active'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('responses'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /database/migrations/2022_12_24_111634_create_companies_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('caption'); 19 | $table->integer('fanavaran_id')->unique(); 20 | $table->integer('is_active'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('companies'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /database/migrations/2023_01_04_145207_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->integer('fanavaran_id')->unique(); 19 | $table->integer('job_category_id'); 20 | $table->string('caption'); 21 | $table->integer('is_active'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('jobs'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2023_01_08_170816_create_life_insurances_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('insurance_target'); 19 | $table->string('birth_year'); 20 | $table->string('birth_month'); 21 | $table->string('birth_day'); 22 | $table->string('life_ins_duration'); 23 | $table->string('payment_method'); 24 | $table->string('annual_payment'); 25 | $table->string('first_job_level'); 26 | $table->string('first_job_level_id'); 27 | $table->string('second_job_level'); 28 | $table->string('second_job_level_id'); 29 | $table->string('divided_payment'); 30 | $table->string('annual_payment_increase'); 31 | $table->string('addon_payment_method'); 32 | $table->string('death_capital_any_reason_ratio'); 33 | $table->string('capital_increase'); 34 | $table->string('death_capital_incident_ratio')->nullable(); 35 | $table->string('maim_ratio')->nullable(); 36 | $table->string('has_medical_cost')->nullable(); 37 | $table->string('additional_dangers')->nullable(); 38 | $table->string('hospitalization')->nullable(); 39 | $table->string('exemption')->nullable(); 40 | $table->string('special_diseases_ratio')->nullable(); 41 | $table->string('national_code')->unique()->nullable(); 42 | $table->string('mobile_number')->nullable(); 43 | $table->string('ins_target_height')->nullable(); 44 | $table->string('ins_target_weight')->nullable(); 45 | $table->string('gender')->nullable(); 46 | $table->string('military_service_status')->nullable(); 47 | $table->string('military_service_details')->nullable(); 48 | $table->string('military_service_reason')->nullable(); 49 | $table->string('father_life_status')->nullable(); 50 | $table->string('father_age')->nullable(); 51 | $table->string('father_death_reason')->nullable(); 52 | $table->string('mother_life_status')->nullable(); 53 | $table->string('mother_age')->nullable(); 54 | $table->string('mother_death_reason')->nullable(); 55 | $table->string('family_health_history')->nullable(); 56 | $table->string('family_health_history_reason')->nullable(); 57 | $table->string('smoking_status')->nullable(); 58 | $table->string('hospitalization_status')->nullable(); 59 | $table->string('hospitalization_reason')->nullable(); 60 | $table->string('physical_impairment')->nullable(); 61 | $table->string('drug_usage')->nullable(); 62 | $table->string('health_status')->nullable(); 63 | $table->string('disease_type')->nullable(); 64 | $table->string('weight_loss')->nullable(); 65 | $table->string('weight_loss_reason')->nullable(); 66 | $table->unsignedBigInteger('user_id')->nullable(); 67 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); 68 | $table->timestamps(); 69 | }); 70 | } 71 | 72 | /** 73 | * Reverse the migrations. 74 | * 75 | * @return void 76 | */ 77 | public function down() 78 | { 79 | Schema::dropIfExists('life_insurances'); 80 | } 81 | }; 82 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 18 | 19 | // \App\Models\User::factory()->create([ 20 | // 'name' => 'Test User', 21 | // 'email' => 'test@example.com', 22 | // ]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'password' => 'The provided password is incorrect.', 18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have emailed your password reset link!', 18 | 'throttled' => 'Please wait before retrying.', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /lang/fa/auth.php: -------------------------------------------------------------------------------- 1 | 'مشخصات وارد شده با اطلاعات ما سازگار نیست.', 16 | 'password' => 'رمز عبور شما معتبر نیست.', 17 | 'throttle' => 'دفعات تلاش شما برای ورود بیش از حد مجاز است. لطفا پس از :seconds ثانیه مجددا تلاش فرمایید.', 18 | ]; -------------------------------------------------------------------------------- /lang/fa/pagination.php: -------------------------------------------------------------------------------- 1 | 'بعدی »', 16 | 'previous' => '« قبلی', 17 | ]; -------------------------------------------------------------------------------- /lang/fa/passwords.php: -------------------------------------------------------------------------------- 1 | 'رمز عبور شما بازگردانی شد!', 16 | 'sent' => 'لینک بازگردانی رمز عبور به ایمیل شما ارسال شد.', 17 | 'throttled' => 'پیش از تلاش مجدد کمی صبر کنید.', 18 | 'token' => 'مشخصه‌ی بازگردانی رمز عبور معتبر نیست.', 19 | 'user' => 'ما کاربری با این نشانی ایمیل نداریم!', 20 | ]; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vite build" 6 | }, 7 | "devDependencies": { 8 | "axios": "^1.1.2", 9 | "laravel-vite-plugin": "^0.7.2", 10 | "lodash": "^4.17.19", 11 | "postcss": "^8.1.14", 12 | "vite": "^4.0.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /public/pdf-export-assets/css/app.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'iransans'; 3 | src: url('../fonts/iransans.eot'); 4 | src: url('../fonts/iransans.eot?#iefix') format('embedded-opentype'), 5 | url('../fonts/iransans.woff') format('woff'), 6 | url('../fonts/iransans.ttf') format('truetype') 7 | } 8 | 9 | .checked::before, 10 | .checked::after { 11 | position: absolute; 12 | } 13 | 14 | .checked::before { 15 | content: ""; 16 | border: 2px solid #716f64; 17 | border-right-color: transparent; 18 | border-bottom-color: transparent; 19 | top: -1px; 20 | left: -1px; 21 | height: 10px; 22 | width: 10px; 23 | } 24 | 25 | .ckecked-wide::after { 26 | display: none; 27 | } 28 | 29 | .ckecked-wide::before { 30 | width: 85px; 31 | height: 23px; 32 | } 33 | 34 | .check-set-width::before { 35 | width: 56px; 36 | } 37 | 38 | .new-page { 39 | page-break-before: always; 40 | } -------------------------------------------------------------------------------- /public/pdf-export-assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/pdf-export-assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/pdf-export-assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/pdf-export-assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/pdf-export-assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/pdf-export-assets/fonts/iransans.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/fonts/iransans.eot -------------------------------------------------------------------------------- /public/pdf-export-assets/fonts/iransans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/fonts/iransans.ttf -------------------------------------------------------------------------------- /public/pdf-export-assets/fonts/iransans.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/fonts/iransans.woff -------------------------------------------------------------------------------- /public/pdf-export-assets/images/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/images/apple.png -------------------------------------------------------------------------------- /public/pdf-export-assets/images/barcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/images/barcode.png -------------------------------------------------------------------------------- /public/pdf-export-assets/images/logo-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/images/logo-left.png -------------------------------------------------------------------------------- /public/pdf-export-assets/images/logo-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/public/pdf-export-assets/images/logo-right.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /react-life-form/.env.example: -------------------------------------------------------------------------------- 1 | VITE_API_BASE_URL=http://localhost:8000 2 | VITE_BASE_URL=http://localhost:8080 -------------------------------------------------------------------------------- /react-life-form/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /react-life-form/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | سایت بیمه 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /react-life-form/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "step-form", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite --port=8080", 8 | "build": "vite build", 9 | "preview": "vite preview", 10 | "watch": "vite build --watch" 11 | }, 12 | "dependencies": { 13 | "axios": "^1.2.2", 14 | "react": "^18.2.0", 15 | "react-date-object": "^2.1.5", 16 | "react-dom": "^18.2.0", 17 | "react-router-dom": "^6.6.1", 18 | "universal-cookie": "^4.0.4", 19 | "web-vitals": "^3.1.0" 20 | }, 21 | "devDependencies": { 22 | "@types/react": "^18.0.26", 23 | "@types/react-dom": "^18.0.9", 24 | "@vitejs/plugin-react": "^3.0.0", 25 | "vite": "^4.0.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /react-life-form/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /react-life-form/src/Dashboard.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | 3 | function Dashboard() { 4 | 5 | return ( 6 |
7 |

داشبورد

8 |
9 | ) 10 | } 11 | 12 | export default Dashboard 13 | -------------------------------------------------------------------------------- /react-life-form/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /react-life-form/src/axios-client.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { useStateContext } from "./context/ContextProvider.jsx"; 3 | 4 | const axiosClient = axios.create({ 5 | baseURL: `${import.meta.env.VITE_API_BASE_URL}/api`, 6 | }); 7 | 8 | axiosClient.interceptors.request.use((config) => { 9 | const token = localStorage.getItem("ACCESS_TOKEN"); 10 | config.headers.Authorization = `Bearer ${token}`; 11 | return config; 12 | }); 13 | 14 | axiosClient.interceptors.response.use( 15 | (response) => { 16 | return response; 17 | }, 18 | (error) => { 19 | const { response } = error; 20 | if (response.status === 401) { 21 | localStorage.removeItem("ACCESS_TOKEN"); 22 | // window.location.reload(); 23 | } else if (response.status === 404) { 24 | //Show not found 25 | } 26 | 27 | throw error; 28 | } 29 | ); 30 | 31 | export default axiosClient; 32 | -------------------------------------------------------------------------------- /react-life-form/src/components/DefaultLayout.jsx: -------------------------------------------------------------------------------- 1 | import { Link, Navigate, Outlet } from "react-router-dom"; 2 | import { useStateContext } from "../context/ContextProvider"; 3 | import axiosClient from "../axios-client.js"; 4 | import { useEffect } from "react"; 5 | 6 | export default function DefaultLayout() { 7 | const { user, token, setUser, setToken, notification, setNext } = useStateContext(); 8 | 9 | if (!token) { 10 | return ; 11 | } 12 | 13 | const onLogout = (ev) => { 14 | ev.preventDefault(); 15 | 16 | axiosClient.post("/logout").then(() => { 17 | setUser({}); 18 | setToken(null); 19 | }); 20 | }; 21 | 22 | useEffect(() => { 23 | axiosClient.get("/user").then(({ data }) => { 24 | setUser(data); 25 | }); 26 | setNext(null); 27 | }, []); 28 | 29 | return ( 30 |
31 | 37 |
38 |
39 |
40 | 41 |
42 | سلام آقای {user.name}     43 | 44 | خروج 45 | 46 |
47 |
48 |
49 | 50 |
51 | {notification && ( 52 |
{notification}
53 | )} 54 |
55 |
56 | ); 57 | } 58 | -------------------------------------------------------------------------------- /react-life-form/src/components/GuestLayout.jsx: -------------------------------------------------------------------------------- 1 | import { Navigate, Outlet } from "react-router-dom"; 2 | import { useStateContext } from "../context/ContextProvider"; 3 | 4 | export default function GuestLayout() { 5 | const { user, token, notification, next, setNext } = useStateContext(); 6 | 7 | if (token) { 8 | if (next) { 9 | return ; 10 | } else { 11 | return ; 12 | } 13 | // navigate(-1); 14 | } 15 | 16 | return ( 17 |
18 | 19 | {notification &&
{notification}
} 20 |
21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /react-life-form/src/context/ContextProvider.jsx: -------------------------------------------------------------------------------- 1 | import { createContext, useContext, useState } from "react"; 2 | 3 | const StateContext = createContext({ 4 | currentUser: null, 5 | token: null, 6 | notification: null, 7 | next: null, 8 | insurancedId: null, 9 | setUser: () => {}, 10 | setToken: () => {}, 11 | setNotification: () => {}, 12 | setNext: () => {}, 13 | setInsurancedId: () => {}, 14 | }); 15 | 16 | export const ContextProvider = ({ children }) => { 17 | const [user, setUser] = useState({}); 18 | const [token, _setToken] = useState(localStorage.getItem("ACCESS_TOKEN")); 19 | const [notification, _setNotification] = useState(""); 20 | const [next, _setNext] = useState(localStorage.getItem("NEXT")); 21 | const [insurancedId, _setInsurancedId] = useState( 22 | localStorage.getItem("INSURANCED_ID") 23 | ); 24 | 25 | const setToken = (token) => { 26 | _setToken(token); 27 | if (token) { 28 | localStorage.setItem("ACCESS_TOKEN", token); 29 | } else { 30 | localStorage.removeItem("ACCESS_TOKEN"); 31 | } 32 | }; 33 | 34 | const setNotification = (message) => { 35 | _setNotification(message); 36 | 37 | setTimeout(() => { 38 | _setNotification(""); 39 | }, 5000); 40 | }; 41 | 42 | const setInsurancedId = (insurancedId) => { 43 | _setInsurancedId(insurancedId); 44 | if (insurancedId) { 45 | localStorage.setItem("INSURANCED_ID", insurancedId); 46 | } else { 47 | localStorage.removeItem("INSURANCED_ID"); 48 | } 49 | }; 50 | 51 | const setNext = (next) => { 52 | _setNext(next); 53 | if (next) { 54 | localStorage.setItem("NEXT", next); 55 | } else { 56 | localStorage.removeItem("NEXT"); 57 | } 58 | }; 59 | 60 | return ( 61 | 75 | {children} 76 | 77 | ); 78 | }; 79 | 80 | export const useStateContext = () => useContext(StateContext); 81 | -------------------------------------------------------------------------------- /react-life-form/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import Dashboard from "./Dashboard.jsx"; 4 | import "./index.css"; 5 | import { RouterProvider } from "react-router-dom"; 6 | import router from "./router.jsx"; 7 | import { ContextProvider } from "./context/ContextProvider.jsx"; 8 | import reportWebVitals from "./reportWebVitals"; 9 | 10 | ReactDOM.createRoot(document.getElementById("root")).render( 11 | <> 12 | 13 | 14 | 15 | 16 | ); 17 | 18 | reportWebVitals(); -------------------------------------------------------------------------------- /react-life-form/src/reportWebVitals.jsx: -------------------------------------------------------------------------------- 1 | const reportWebVitals = (onPerfEntry) => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import("web-vitals").then( 4 | ({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 5 | getCLS(onPerfEntry); 6 | getFID(onPerfEntry); 7 | getFCP(onPerfEntry); 8 | getLCP(onPerfEntry); 9 | getTTFB(onPerfEntry); 10 | } 11 | ); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /react-life-form/src/router.jsx: -------------------------------------------------------------------------------- 1 | import { createBrowserRouter, Navigate } from "react-router-dom"; 2 | import Dashboard from "./Dashboard.jsx"; 3 | import DefaultLayout from "./components/DefaultLayout"; 4 | import GuestLayout from "./components/GuestLayout"; 5 | import Login from "./views/Login"; 6 | import NotFound from "./views/NotFound"; 7 | import Signup from "./views/Signup"; 8 | import Users from "./views/Users"; 9 | import Lifes from "./views/Lifes"; 10 | import UserForm from "./views/UserForm"; 11 | import MultiStepForm from "./views/form-0/MultiStepForm"; 12 | import LifeCompare from "./views/form-1/LifeCompare"; 13 | import LifeMedicalInfo from "./views/form-2/LifeMedicalInfo"; 14 | import InsuranceTargetDetails from "./views/form-3/InsuranceTargetDetails"; 15 | 16 | const router = createBrowserRouter([ 17 | { 18 | path: "/", 19 | element: , 20 | children: [ 21 | { 22 | path: "/", 23 | element: , 24 | }, 25 | { 26 | path: "/dashboard", 27 | element: , 28 | }, 29 | { 30 | path: "/users", 31 | element: , 32 | }, 33 | { 34 | path: "/users/new", 35 | element: , 36 | }, 37 | { 38 | path: "/users/:id", 39 | element: , 40 | }, 41 | { 42 | path: "/lifes", 43 | element: , 44 | }, 45 | { 46 | path: "/life-insurance", 47 | element: , 48 | }, 49 | // { 50 | // path: "/life", 51 | // element: , 52 | // }, 53 | { 54 | path: "/life-medical-info", 55 | element: , 56 | }, 57 | { 58 | path: "/insurance-target-details", 59 | element: , 60 | }, 61 | ], 62 | }, 63 | { 64 | path: "/", 65 | element: , 66 | children: [ 67 | { 68 | path: "/login", 69 | element: , 70 | }, 71 | { 72 | path: "/signup", 73 | element: , 74 | }, 75 | { 76 | path: "/life", 77 | element: , 78 | }, 79 | { 80 | path: "/life-compare", 81 | element: , 82 | }, 83 | ], 84 | }, 85 | { 86 | path: "*", 87 | element: , 88 | }, 89 | ]); 90 | 91 | export default router; 92 | -------------------------------------------------------------------------------- /react-life-form/src/views/Login.jsx: -------------------------------------------------------------------------------- 1 | import { Link } from "react-router-dom"; 2 | import axiosClient from "../axios-client.js"; 3 | import { createRef, useState } from "react"; 4 | import { useStateContext } from "../context/ContextProvider.jsx"; 5 | 6 | export default function Login() { 7 | const emailRef = createRef(); 8 | const passwordRef = createRef(); 9 | const { setUser, setToken } = useStateContext(); 10 | const [message, setMessage] = useState(null); 11 | 12 | const onSubmit = (ev) => { 13 | ev.preventDefault(); 14 | 15 | const payload = { 16 | email: emailRef.current.value, 17 | password: passwordRef.current.value, 18 | }; 19 | axiosClient 20 | .post("/login", payload) 21 | .then(({ data }) => { 22 | setUser(data.user); 23 | setToken(data.token); 24 | }) 25 | .catch((err) => { 26 | const response = err.response; 27 | if (response && response.status === 422) { 28 | setMessage(response.data.message); 29 | } 30 | }); 31 | }; 32 | 33 | return ( 34 |
35 |
36 |
37 |

ورود حساب کاربری

38 | 39 | {message && ( 40 |
41 |

{message}

42 |
43 | )} 44 | 45 | 46 | 51 | 52 |

53 | حسابی ندارید؟{" "} 54 | ساختن حساب کاربری 55 |

56 |
57 |
58 |
59 | ); 60 | } 61 | -------------------------------------------------------------------------------- /react-life-form/src/views/NotFound.jsx: -------------------------------------------------------------------------------- 1 | export default function NotFound() { 2 | return ( 3 |
4 |

404 صفحه پیدا نشد!!!؟؟

5 |
6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /react-life-form/src/views/Signup.jsx: -------------------------------------------------------------------------------- 1 | import { Link } from "react-router-dom"; 2 | import { createRef, useState } from "react"; 3 | import axiosClient from "../axios-client.js"; 4 | import { useStateContext } from "../context/ContextProvider.jsx"; 5 | 6 | export default function Signup() { 7 | const nameRef = createRef(); 8 | const emailRef = createRef(); 9 | const passwordRef = createRef(); 10 | const passwordConfirmationRef = createRef(); 11 | const { setUser, setToken } = useStateContext(); 12 | const [errors, setErrors] = useState(null); 13 | 14 | const onSubmit = (ev) => { 15 | ev.preventDefault(); 16 | 17 | const payload = { 18 | name: nameRef.current.value, 19 | email: emailRef.current.value, 20 | password: passwordRef.current.value, 21 | password_confirmation: passwordConfirmationRef.current.value, 22 | }; 23 | axiosClient 24 | .post("/signup", payload) 25 | .then(({ data }) => { 26 | setUser(data.user); 27 | setToken(data.token); 28 | }) 29 | .catch((err) => { 30 | const response = err.response; 31 | if (response && response.status === 422) { 32 | setErrors(response.data.errors); 33 | } 34 | }); 35 | }; 36 | 37 | return ( 38 |
39 |
40 |
41 |

ثبت نام

42 | {errors && ( 43 |
44 | {Object.keys(errors).map((key) => ( 45 |

{errors[key][0]}

46 | ))} 47 |
48 | )} 49 | 50 | 55 | 60 | 65 | 66 |

67 | حساب کاربری دارید؟ ورود 68 |

69 |
70 |
71 |
72 | ); 73 | } 74 | -------------------------------------------------------------------------------- /react-life-form/src/views/UserForm.jsx: -------------------------------------------------------------------------------- 1 | import { useNavigate, useParams } from "react-router-dom"; 2 | import { useEffect, useState } from "react"; 3 | import axiosClient from "../axios-client.js"; 4 | import { useStateContext } from "../context/ContextProvider.jsx"; 5 | 6 | export default function UserForm() { 7 | const navigate = useNavigate(); 8 | let { id } = useParams(); 9 | const [user, setUser] = useState({ 10 | id: null, 11 | name: "", 12 | email: "", 13 | password: "", 14 | password_confirmation: "", 15 | }); 16 | const [errors, setErrors] = useState(null); 17 | const [loading, setLoading] = useState(false); 18 | const { setNotification } = useStateContext(); 19 | 20 | if (id) { 21 | useEffect(() => { 22 | setLoading(true); 23 | axiosClient 24 | .get(`/users/${id}`) 25 | .then(({ data }) => { 26 | setLoading(false); 27 | setUser(data); 28 | }) 29 | .catch(() => { 30 | setLoading(false); 31 | }); 32 | }, []); 33 | } 34 | 35 | const onSubmit = (ev) => { 36 | ev.preventDefault(); 37 | if (user.id) { 38 | axiosClient 39 | .put(`/users/${user.id}`, user) 40 | .then(() => { 41 | setNotification("کاربر بروزرسانی شد.!"); 42 | navigate("/users"); 43 | }) 44 | .catch((err) => { 45 | const response = err.response; 46 | if (response && response.status === 422) { 47 | setErrors(response.data.errors); 48 | } 49 | }); 50 | } else { 51 | axiosClient 52 | .post("/users", user) 53 | .then(() => { 54 | setNotification("کاربر ساخته شد."); 55 | navigate("/users"); 56 | }) 57 | .catch((err) => { 58 | const response = err.response; 59 | if (response && response.status === 422) { 60 | setErrors(response.data.errors); 61 | } 62 | }); 63 | } 64 | }; 65 | 66 | return ( 67 | <> 68 | {user.id &&

Update User: {user.name}

} 69 | {!user.id &&

New User

} 70 |
71 | {loading &&
Loading...
} 72 | {errors && ( 73 |
74 | {Object.keys(errors).map((key) => ( 75 |

{errors[key][0]}

76 | ))} 77 |
78 | )} 79 | {!loading && ( 80 |
81 | 84 | setUser({ ...user, name: ev.target.value }) 85 | } 86 | placeholder="نام" 87 | /> 88 | 91 | setUser({ ...user, email: ev.target.value }) 92 | } 93 | placeholder="ایمیل" 94 | /> 95 | 98 | setUser({ ...user, password: ev.target.value }) 99 | } 100 | placeholder="رمز عبور" 101 | /> 102 | 105 | setUser({ 106 | ...user, 107 | password_confirmation: ev.target.value, 108 | }) 109 | } 110 | placeholder="تکرار رمز عبور" 111 | /> 112 | 113 |
114 | )} 115 |
116 | 117 | ); 118 | } 119 | -------------------------------------------------------------------------------- /react-life-form/src/views/Users.jsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | import axiosClient from "../axios-client.js"; 3 | import { Link } from "react-router-dom"; 4 | import { useStateContext } from "../context/ContextProvider.jsx"; 5 | 6 | export default function Users() { 7 | const [users, setUsers] = useState([]); 8 | const [loading, setLoading] = useState(false); 9 | const { setNotification } = useStateContext(); 10 | 11 | useEffect(() => { 12 | getUsers(); 13 | }, []); 14 | 15 | const onDeleteClick = (user) => { 16 | if (!window.confirm("Are you sure you want to delete this user?")) { 17 | return; 18 | } 19 | axiosClient.delete(`/users/${user.id}`).then(() => { 20 | setNotification("User was successfully deleted"); 21 | getUsers(); 22 | }); 23 | }; 24 | 25 | const getUsers = () => { 26 | setLoading(true); 27 | axiosClient 28 | .get("/users") 29 | .then(({ data }) => { 30 | setLoading(false); 31 | setUsers(data.data); 32 | }) 33 | .catch(() => { 34 | setLoading(false); 35 | }); 36 | }; 37 | 38 | return ( 39 |
40 |
47 |

کاربران

48 | 49 | اضافه کردن کاربر 50 | 51 |
52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | {loading && ( 64 | 65 | 66 | 69 | 70 | 71 | )} 72 | {!loading && ( 73 | 74 | {users.map((u) => ( 75 | 76 | 77 | 78 | 79 | 80 | 95 | 96 | ))} 97 | 98 | )} 99 |
آیدینامایمیلتاریخ ایجادمدیریت
67 | در حال لود شدن... 68 |
{u.id}{u.name}{u.email}{u.created_at} 81 | 85 | تغییر 86 | 87 |   88 | 94 |
100 |
101 |
102 | ); 103 | } 104 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-0/InsuranceInfo.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import DateObject from "react-date-object"; 3 | import persian from "react-date-object/calendars/persian"; 4 | import persian_fa from "react-date-object/locales/persian_fa"; 5 | 6 | function InsuranceInfo({ formData, setFormData }) { 7 | const now = new DateObject({ 8 | date: new Date(), 9 | calendar: persian, 10 | locale: persian_fa, 11 | }); 12 | const durations = []; 13 | if (now.year - parseInt(formData["birth_year"]) >= 59) { 14 | for ( 15 | let i = 0; 16 | i < 65 - now.year + parseInt(formData["birth_year"]) + 1; 17 | i++ 18 | ) { 19 | durations.push(i + 5); 20 | } 21 | } else { 22 | for ( 23 | let i = 0; 24 | i < 64 - now.year + parseInt(formData["birth_year"]) + 11 && i < 26; 25 | i++ 26 | ) { 27 | durations.push(i + 5); 28 | } 29 | } 30 | 31 | const handleChange = (e) => { 32 | setFormData({ ...formData, [e.target.name]: e.target.value }); 33 | }; 34 | 35 | const handleannualPayment = (e) => { 36 | setFormData({ 37 | ...formData, 38 | [e.target.name]: parseInt(e.target.value.replace(/,/g, "")) 39 | ? parseInt(e.target.value.replace(/,/g, "")).toLocaleString() 40 | : 0, 41 | }); 42 | }; 43 | 44 | return ( 45 |
46 | 66 | 83 | 91 |
92 | ); 93 | } 94 | 95 | export default InsuranceInfo; 96 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-0/JobInfo.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import Jobs from "../../Jobs.json"; 3 | 4 | function JobInfo({ formData, setFormData }) { 5 | const [results, setResults] = useState([]); 6 | 7 | const search = (query) => { 8 | const results = 9 | query.target.value.length > 2 10 | ? Jobs.filter((value) => { 11 | return value.caption.toLowerCase().includes( 12 | query.target.value.toLowerCase() 13 | ); 14 | }) 15 | : []; 16 | setResults({ ...results, results }); 17 | }; 18 | 19 | const handleChange = (e) => { 20 | setFormData({ 21 | ...formData, 22 | [e.target.name]: e.target.value, 23 | job_id: 0, 24 | }); 25 | search(e); 26 | }; 27 | 28 | return ( 29 |
30 | 37 | {results.results?.map((item, index) => { 38 | if (index < 5) { 39 | return ( 40 | { 42 | setFormData({ 43 | ...formData, 44 | job_id: item.fanavaran_id.toString(), 45 | job: e.target.innerHTML, 46 | }); 47 | setResults([]); 48 | }} 49 | key={index} 50 | className="job-offer" 51 | > 52 | {item.caption} 53 | 54 | ); 55 | } 56 | })} 57 |
58 | ); 59 | } 60 | 61 | export default JobInfo; 62 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-1/LifeCompareItem.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import "./lifeCompareItem.css"; 3 | 4 | const LifeCompareItem = (props) => { 5 | const { 6 | label, 7 | errorMessage, 8 | onChange, 9 | onClick, 10 | id, 11 | type, 12 | options, 13 | error, 14 | defaultValue, 15 | disabled, 16 | ...inputProps 17 | } = props; 18 | const [focused, setFocused] = useState(false); 19 | 20 | const handleFocus = (e) => { 21 | setFocused(true); 22 | }; 23 | 24 | switch (type) { 25 | case "select": 26 | return ( 27 |
28 | 29 | 56 | {errorMessage} 57 | {error} 58 |
59 | ); 60 | break; 61 | default: 62 | return ( 63 |
64 | 65 | 74 | {errorMessage} 75 | {error} 76 | {(inputProps.name == "first_job_level" || 77 | inputProps.name == "second_job_level") && ( 78 |
    79 | {options?.map((item, index) => { 80 | if (index < 5) { 81 | return ( 82 |
  • 88 | {item.caption} 89 |
  • 90 | ); 91 | } 92 | })} 93 |
94 | )} 95 |
96 | ); 97 | break; 98 | } 99 | }; 100 | 101 | export default LifeCompareItem; 102 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-1/lifeCompare.css: -------------------------------------------------------------------------------- 1 | .life-compare { 2 | display: flex; 3 | align-items: center; 4 | justify-content: right; 5 | padding-right: 1%; 6 | height: 100%; 7 | background-size: cover; 8 | background-position: center; 9 | } 10 | 11 | .life-compare-form { 12 | width: 40%; 13 | height: 100%; 14 | background-color: white; 15 | padding: 0px 60px; 16 | border-radius: 10px; 17 | background-color: rgba(0, 0, 0, 0.247); 18 | background-position: center; 19 | } 20 | 21 | .life-compare-h1 { 22 | color: rgb(77, 1, 77); 23 | text-align: center; 24 | margin: 35px; 25 | } 26 | 27 | .life-compare-button { 28 | width: 80%; 29 | height: 50px; 30 | padding: 10px; 31 | border: none; 32 | background-color: rebeccapurple; 33 | color: white; 34 | border-radius: 5px; 35 | font-weight: bold; 36 | font-size: 18px; 37 | cursor: pointer; 38 | margin-top: 15px; 39 | margin-bottom: 30px; 40 | margin-right: 10%; 41 | } 42 | 43 | 44 | .life-compare-nav { 45 | display: flex; 46 | width: 80%; 47 | height: 50px; 48 | padding: 10px; 49 | border: none; 50 | background-color: rgba(102, 51, 153, 0.457); 51 | color: white; 52 | border-radius: 5px; 53 | font-weight: bold; 54 | font-size: 18px; 55 | text-align: center; 56 | cursor: pointer; 57 | margin-top: 15px; 58 | margin-bottom: 30px; 59 | margin-right: 10%; 60 | align-items: center; 61 | justify-items: center; 62 | } 63 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-1/lifeCompareItem.css: -------------------------------------------------------------------------------- 1 | .life-compare-form-input { 2 | display: flex; 3 | flex-direction: column; 4 | width: 100%; 5 | } 6 | 7 | .life-compare-input { 8 | padding: 15px; 9 | margin: 10px 0px; 10 | border-radius: 5px; 11 | border: 1px solid gray; 12 | text-align: right; 13 | font-size: 16px; 14 | font-weight: 600; 15 | text-align: center; 16 | } 17 | 18 | 19 | .life-compare-label { 20 | font-size: 14px; 21 | color: gray; 22 | text-align: right; 23 | } 24 | 25 | .life-compare-span { 26 | font-size: 12px; 27 | padding: 3px; 28 | color: red; 29 | display: none; 30 | font-size: 14px; 31 | font-weight: 600; 32 | text-align: right; 33 | direction: rtl; 34 | } 35 | .life-compare-span-error { 36 | font-size: 12px; 37 | padding: 3px; 38 | color: red; 39 | font-size: 14px; 40 | font-weight: 600; 41 | text-align: right; 42 | direction: rtl; 43 | } 44 | 45 | input:invalid[focused="true"]{ 46 | border: 2px solid red; 47 | } 48 | 49 | input:invalid[focused="true"] ~ span{ 50 | display: block; 51 | } 52 | 53 | select:invalid[focused="true"]{ 54 | border: 2px solid red; 55 | } 56 | 57 | select:invalid[focused="true"] ~ span{ 58 | display: block; 59 | } 60 | 61 | .life-compare-form-select { 62 | display: flex; 63 | flex-direction: column; 64 | width: 100%; 65 | } 66 | 67 | 68 | .life-compare-select { 69 | padding: 15px; 70 | margin: 10px 0px; 71 | border-radius: 5px; 72 | border: 1px solid gray; 73 | text-align: right; 74 | font-size: 16px; 75 | font-weight: 600; 76 | text-align: center; 77 | } 78 | 79 | .life-compare-select-error { 80 | padding: 15px; 81 | margin: 10px 0px; 82 | border-radius: 5px; 83 | border: 1px solid gray; 84 | text-align: right; 85 | font-size: 16px; 86 | font-weight: 600; 87 | text-align: center; 88 | border: 2px solid red; 89 | } 90 | 91 | .ui-menu-item { 92 | cursor: pointer; 93 | font-weight: 600; 94 | border-radius: 5px; 95 | border: 1px solid gray; 96 | padding: 4px; 97 | margin: 2px; 98 | background-color: azure; 99 | text-align: center; 100 | } -------------------------------------------------------------------------------- /react-life-form/src/views/form-2/LifeMedicalInfoItem.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import "./lifeMedicalInfoItem.css"; 3 | 4 | const LifeMedicalInfoItem = (props) => { 5 | const { 6 | label, 7 | errorMessage, 8 | onChange, 9 | onClick, 10 | id, 11 | type, 12 | options, 13 | error, 14 | defaultValue, 15 | disabled, 16 | ...inputProps 17 | } = props; 18 | const [focused, setFocused] = useState(false); 19 | 20 | const handleFocus = (e) => { 21 | setFocused(true); 22 | }; 23 | 24 | switch (type) { 25 | case "select": 26 | return ( 27 |
28 | 29 | 56 | {errorMessage} 57 | {error} 58 |
59 | ); 60 | break; 61 | default: 62 | return ( 63 |
64 | 65 | 78 | {errorMessage} 79 | {error} 80 |
81 | ); 82 | break; 83 | } 84 | }; 85 | 86 | export default LifeMedicalInfoItem; 87 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-2/lifeMedicalInfo.css: -------------------------------------------------------------------------------- 1 | .life-compare { 2 | display: flex; 3 | align-items: center; 4 | justify-content: right; 5 | padding-right: 1%; 6 | height: 100%; 7 | background-size: cover; 8 | background-position: center; 9 | } 10 | 11 | .life-medical-form { 12 | width: 80%; 13 | height: 100%; 14 | background-color: white; 15 | padding: 0px 60px; 16 | border-radius: 10px; 17 | background-color: rgba(0, 0, 0, 0.247); 18 | background-position: center; 19 | } 20 | 21 | .life-compare-h1 { 22 | color: rgb(77, 1, 77); 23 | text-align: center; 24 | margin: 35px; 25 | } 26 | 27 | .life-compare-button { 28 | width: 80%; 29 | height: 50px; 30 | padding: 10px; 31 | border: none; 32 | background-color: rebeccapurple; 33 | color: white; 34 | border-radius: 5px; 35 | font-weight: bold; 36 | font-size: 18px; 37 | cursor: pointer; 38 | margin-top: 15px; 39 | margin-bottom: 30px; 40 | margin-right: 10%; 41 | } 42 | 43 | 44 | .life-compare-nav { 45 | display: flex; 46 | width: 80%; 47 | height: 50px; 48 | padding: 10px; 49 | border: none; 50 | background-color: rgba(102, 51, 153, 0.457); 51 | color: white; 52 | border-radius: 5px; 53 | font-weight: bold; 54 | font-size: 18px; 55 | text-align: center; 56 | cursor: pointer; 57 | margin-top: 15px; 58 | margin-bottom: 30px; 59 | margin-right: 10%; 60 | align-items: center; 61 | justify-items: center; 62 | } 63 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-2/lifeMedicalInfoItem.css: -------------------------------------------------------------------------------- 1 | .life-compare-form-input { 2 | display: flex; 3 | flex-direction: column; 4 | width: 100%; 5 | } 6 | 7 | .life-compare-input { 8 | padding: 15px; 9 | margin: 10px 0px; 10 | border-radius: 5px; 11 | border: 1px solid gray; 12 | text-align: right; 13 | font-size: 16px; 14 | font-weight: 600; 15 | text-align: center; 16 | } 17 | 18 | .life-compare-input-error { 19 | padding: 15px; 20 | margin: 10px 0px; 21 | border-radius: 5px; 22 | border: 1px solid gray; 23 | text-align: right; 24 | font-size: 16px; 25 | font-weight: 600; 26 | text-align: center; 27 | border: 2px solid red; 28 | } 29 | 30 | 31 | .life-compare-label { 32 | font-size: 14px; 33 | color: gray; 34 | text-align: right; 35 | } 36 | 37 | .life-compare-span { 38 | font-size: 12px; 39 | padding: 3px; 40 | color: red; 41 | display: none; 42 | font-size: 14px; 43 | font-weight: 600; 44 | text-align: right; 45 | direction: rtl; 46 | } 47 | .life-compare-span-error { 48 | font-size: 12px; 49 | padding: 3px; 50 | color: red; 51 | font-size: 14px; 52 | font-weight: 600; 53 | text-align: right; 54 | direction: rtl; 55 | } 56 | 57 | input:invalid[focused="true"]{ 58 | border: 2px solid red; 59 | } 60 | 61 | input:invalid[focused="true"] ~ span{ 62 | display: block; 63 | } 64 | 65 | select:invalid[focused="true"]{ 66 | border: 2px solid red; 67 | } 68 | 69 | select:invalid[focused="true"] ~ span{ 70 | display: block; 71 | } 72 | 73 | .life-compare-form-select { 74 | display: flex; 75 | flex-direction: column; 76 | width: 100%; 77 | } 78 | 79 | 80 | .life-compare-select { 81 | padding: 15px; 82 | margin: 10px 0px; 83 | border-radius: 5px; 84 | border: 1px solid gray; 85 | text-align: right; 86 | font-size: 16px; 87 | font-weight: 600; 88 | text-align: center; 89 | } 90 | 91 | .life-compare-select-error { 92 | padding: 15px; 93 | margin: 10px 0px; 94 | border-radius: 5px; 95 | border: 1px solid gray; 96 | text-align: right; 97 | font-size: 16px; 98 | font-weight: 600; 99 | text-align: center; 100 | border: 2px solid red; 101 | } 102 | 103 | .ui-menu-item { 104 | cursor: pointer; 105 | font-weight: 600; 106 | border-radius: 5px; 107 | border: 1px solid gray; 108 | padding: 4px; 109 | margin: 2px; 110 | background-color: azure; 111 | text-align: center; 112 | } -------------------------------------------------------------------------------- /react-life-form/src/views/form-3/InsuranceTargetDetailsHeir.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import InsuranceTargetDetailsItem from "./InsuranceTargetDetailsItem"; 3 | import "./insuranceTargetDetailsItem.css"; 4 | 5 | const InsuranceTargetDetailsHeir = (props) => { 6 | const { 7 | values, 8 | errors, 9 | disableds, 10 | time, 11 | inputLength, 12 | } = props; 13 | 14 | const inputs = []; 15 | for (let i = 1; i < time + 1; i++) { 16 | inputs.push( 17 | { 18 | id: inputLength + i * 3 + 1 , 19 | type: "text", 20 | label: "کد ملی", 21 | name: `national_codes[${i}]`, 22 | placeholder: "1234567890", 23 | errorMessage: ". کد ملی خود را وارد کنید!!", 24 | required: true, 25 | }, 26 | { 27 | id: inputLength + i * 3 + 2 , 28 | type: "select", 29 | label: "نسبت", 30 | name: `heir_targets[${i}]`, 31 | errorMessage: ". نسبت وارث را وارد کنید!!", 32 | required: true, 33 | options: [ 34 | "خودم", 35 | "همسر", 36 | "فرزند", 37 | "پدر", 38 | "مادر", 39 | "خواهر", 40 | "برادر", 41 | ], 42 | }, 43 | { 44 | id: inputLength + i * 3 + 3 , 45 | type: "text", 46 | label: "درصد سهم", 47 | name: `heir_shares[${i}]`, 48 | placeholder: "10 %", 49 | errorMessage: ". درصد سهم را وارد کنید!!", 50 | required: true, 51 | } 52 | ); 53 | } 54 | 55 | const onChange = (e) => { 56 | // setValues({ ...values, [e.target.name]: e.target.value }); 57 | // setErrors({ ...errors, [e.target.name]: "" }); 58 | handleChange(e); 59 | }; 60 | 61 | const handleChange = (e) => { 62 | if ((new RegExp("national_codes").test(e.target.name))) { 63 | handleNationalCode(e); 64 | }else if ((new RegExp("heir_targets").test(e.target.name))) { 65 | handleHeirTargets(e); 66 | }else if ((new RegExp("heir_shares").test(e.target.name))) { 67 | handleHeirShares(e); 68 | } 69 | }; 70 | 71 | const handleNationalCode = (e) => { 72 | values.national_codes[e.target.name[e.target.name.length - 2]] = e.target.value; 73 | }; 74 | 75 | const handleHeirTargets = (e) => { 76 | values.heir_targets[e.target.name[e.target.name.length - 2]] = e.target.value; 77 | }; 78 | 79 | const handleHeirShares = (e) => { 80 | values.heir_shares[e.target.name[e.target.name.length - 2]] = e.target.value; 81 | }; 82 | return ( 83 | <> 84 | {inputs.map((input) => ( 85 | 94 | ))} 95 | 96 | ); 97 | }; 98 | 99 | export default InsuranceTargetDetailsHeir; 100 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-3/InsuranceTargetDetailsItem.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import "./insuranceTargetDetailsItem.css"; 3 | 4 | const InsuranceTargetDetailsItem = (props) => { 5 | const { 6 | label, 7 | errorMessage, 8 | onChange, 9 | onClick, 10 | id, 11 | type, 12 | options, 13 | error, 14 | defaultValue, 15 | disabled, 16 | heirsElement, 17 | heirs, 18 | ...inputProps 19 | } = props; 20 | const [focused, setFocused] = useState(false); 21 | 22 | const handleFocus = (e) => { 23 | setFocused(true); 24 | }; 25 | 26 | switch (type) { 27 | case "select": 28 | return ( 29 |
30 | 31 | 58 | {errorMessage} 59 | {error} 60 | {(inputProps.name == "user_if_dead" && inputProps.value == 0) && ( 61 |
62 | {heirs < 4 && ()} 63 | {heirs > 1 && ()} 64 |
65 |
66 |
67 | )} 68 | {(inputProps.name == "user_if_dead" && inputProps.value == 0) && (heirsElement)} 69 |
70 | ); 71 | break; 72 | default: 73 | return ( 74 |
75 | 76 | 89 | {errorMessage} 90 | {error} 91 |
92 | ); 93 | break; 94 | } 95 | }; 96 | 97 | export default InsuranceTargetDetailsItem; 98 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-3/insuranceTargetDetails.css: -------------------------------------------------------------------------------- 1 | .life-compare { 2 | display: flex; 3 | align-items: center; 4 | justify-content: right; 5 | padding-right: 1%; 6 | height: 100%; 7 | background-size: cover; 8 | background-position: center; 9 | } 10 | 11 | .life-medical-form { 12 | width: 80%; 13 | height: 100%; 14 | background-color: white; 15 | padding: 0px 60px; 16 | border-radius: 10px; 17 | background-color: rgba(0, 0, 0, 0.247); 18 | background-position: center; 19 | } 20 | 21 | .life-compare-h1 { 22 | color: rgb(77, 1, 77); 23 | text-align: center; 24 | margin: 35px; 25 | } 26 | 27 | .life-compare-button { 28 | width: 80%; 29 | height: 50px; 30 | padding: 10px; 31 | border: none; 32 | background-color: rebeccapurple; 33 | color: white; 34 | border-radius: 5px; 35 | font-weight: bold; 36 | font-size: 18px; 37 | cursor: pointer; 38 | margin-top: 15px; 39 | margin-bottom: 30px; 40 | margin-right: 10%; 41 | } 42 | 43 | 44 | .life-compare-nav { 45 | display: flex; 46 | width: 80%; 47 | height: 50px; 48 | padding: 10px; 49 | border: none; 50 | background-color: rgba(102, 51, 153, 0.457); 51 | color: white; 52 | border-radius: 5px; 53 | font-weight: bold; 54 | font-size: 18px; 55 | text-align: center; 56 | cursor: pointer; 57 | margin-top: 15px; 58 | margin-bottom: 30px; 59 | margin-right: 10%; 60 | align-items: center; 61 | justify-items: center; 62 | } 63 | -------------------------------------------------------------------------------- /react-life-form/src/views/form-3/insuranceTargetDetailsItem.css: -------------------------------------------------------------------------------- 1 | .life-compare-form-input { 2 | display: flex; 3 | flex-direction: column; 4 | width: 100%; 5 | } 6 | 7 | .life-compare-input { 8 | padding: 15px; 9 | margin: 10px 0px; 10 | border-radius: 5px; 11 | border: 1px solid gray; 12 | text-align: right; 13 | font-size: 16px; 14 | font-weight: 600; 15 | text-align: center; 16 | } 17 | 18 | .life-compare-input-error { 19 | padding: 15px; 20 | margin: 10px 0px; 21 | border-radius: 5px; 22 | border: 1px solid gray; 23 | text-align: right; 24 | font-size: 16px; 25 | font-weight: 600; 26 | text-align: center; 27 | border: 2px solid red; 28 | } 29 | 30 | 31 | .life-compare-label { 32 | font-size: 14px; 33 | color: gray; 34 | text-align: right; 35 | } 36 | 37 | .life-compare-span { 38 | font-size: 12px; 39 | padding: 3px; 40 | color: red; 41 | display: none; 42 | font-size: 14px; 43 | font-weight: 600; 44 | text-align: right; 45 | direction: rtl; 46 | } 47 | .life-compare-span-error { 48 | font-size: 12px; 49 | padding: 3px; 50 | color: red; 51 | font-size: 14px; 52 | font-weight: 600; 53 | text-align: right; 54 | direction: rtl; 55 | } 56 | 57 | input:invalid[focused="true"]{ 58 | border: 2px solid red; 59 | } 60 | 61 | input:invalid[focused="true"] ~ span{ 62 | display: block; 63 | } 64 | 65 | select:invalid[focused="true"]{ 66 | border: 2px solid red; 67 | } 68 | 69 | select:invalid[focused="true"] ~ span{ 70 | display: block; 71 | } 72 | 73 | .life-compare-form-select { 74 | display: flex; 75 | flex-direction: column; 76 | width: 100%; 77 | } 78 | 79 | 80 | .life-compare-select { 81 | padding: 15px; 82 | margin: 10px 0px; 83 | border-radius: 5px; 84 | border: 1px solid gray; 85 | text-align: right; 86 | font-size: 16px; 87 | font-weight: 600; 88 | text-align: center; 89 | } 90 | 91 | .life-compare-select-error { 92 | padding: 15px; 93 | margin: 10px 0px; 94 | border-radius: 5px; 95 | border: 1px solid gray; 96 | text-align: right; 97 | font-size: 16px; 98 | font-weight: 600; 99 | text-align: center; 100 | border: 2px solid red; 101 | } 102 | 103 | .ui-menu-item { 104 | cursor: pointer; 105 | font-weight: 600; 106 | border-radius: 5px; 107 | border: 1px solid gray; 108 | padding: 4px; 109 | margin: 2px; 110 | background-color: azure; 111 | text-align: center; 112 | } 113 | 114 | .heir-add-button { 115 | width: 30%; 116 | height: 40px; 117 | border: none; 118 | background-color: rebeccapurple; 119 | color: white; 120 | border-radius: 5px; 121 | font-weight: bold; 122 | font-size: 15px; 123 | cursor: pointer; 124 | margin-top: 15px; 125 | margin-bottom: 30px; 126 | } 127 | 128 | .heir-remove-button { 129 | width: 20%; 130 | height: 40px; 131 | border: none; 132 | background-color: rebeccapurple; 133 | color: white; 134 | border-radius: 5px; 135 | font-weight: bold; 136 | font-size: 15px; 137 | cursor: pointer; 138 | margin-top: 15px; 139 | margin-bottom: 30px; 140 | margin-right: 50%; 141 | display: inline-block; 142 | direction: ltr; 143 | justify-self: start; 144 | } 145 | -------------------------------------------------------------------------------- /react-life-form/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mh97m/React-Life/fd3af697dd3a89a60f1d3b44aeb94cec90c34239/resources/css/app.css -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import _ from 'lodash'; 2 | window._ = _; 3 | 4 | /** 5 | * We'll load the axios HTTP library which allows us to easily issue requests 6 | * to our Laravel back-end. This library automatically handles sending the 7 | * CSRF token as a header based on the value of the "XSRF" token cookie. 8 | */ 9 | 10 | import axios from 'axios'; 11 | window.axios = axios; 12 | 13 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 14 | 15 | /** 16 | * Echo exposes an expressive API for subscribing to channels and listening 17 | * for events that are broadcast by Laravel. Echo and event broadcasting 18 | * allows your team to easily build robust real-time web applications. 19 | */ 20 | 21 | // import Echo from 'laravel-echo'; 22 | 23 | // import Pusher from 'pusher-js'; 24 | // window.Pusher = Pusher; 25 | 26 | // window.Echo = new Echo({ 27 | // broadcaster: 'pusher', 28 | // key: import.meta.env.VITE_PUSHER_APP_KEY, 29 | // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1', 30 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, 31 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, 32 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, 33 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', 34 | // enabledTransports: ['ws', 'wss'], 35 | // }); 36 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | group(function () { 22 | Route::post('/logout', [AuthController::class, 'logout']); 23 | Route::get('/user', function (Request $request) { 24 | return $request->user(); 25 | }); 26 | 27 | Route::get('/assgin-insurance-to-user/{insurance}', [LifeInsurancesController::class, 'assginInsuranceToUser']); 28 | 29 | Route::apiResource('/users', UserController::class); 30 | 31 | Route::get('/lifes', [LifeInsurancesController::class, 'all']); 32 | Route::delete('/lifes/{insurance}', [LifeInsurancesController::class, 'destroy']); 33 | 34 | Route::post('/check-national-code', [LifeInsurancesController::class, 'checkNationalCode']); 35 | 36 | Route::post('/send-verification-code', [LifeInsurancesController::class, 'sendVerificationCode']); 37 | 38 | Route::post('/life-medical-info', [LifeInsurancesController::class, 'storeLifeMedicalInfo']); 39 | 40 | Route::get('/export-excel/{id}', [LifeInsurancesController::class, 'exportExcel']); 41 | 42 | Route::get('/export-pdf/{id}', [LifeInsurancesController::class, 'exportPdf']); 43 | }); 44 | 45 | Route::post('/signup', [AuthController::class, 'signup']); 46 | Route::post('/login', [AuthController::class, 'login']); 47 | Route::post('/life-compare', [LifeInsurancesController::class, 'storeLifeCompare']); 48 | 49 | Route::prefix('v1')->group(function () { 50 | Route::get('/get-jobs', function () { 51 | return Job::get(['fanavaran_id', 'caption']); 52 | }); 53 | Route::get('/update-jobs', function () { 54 | $data = json_encode(Job::get(['fanavaran_id', 'caption']), JSON_UNESCAPED_UNICODE ); 55 | if ($data != file_get_contents(base_path('react-life-form/src/jobs.json'))) { 56 | file_put_contents(base_path('react-life-form/src/jobs.json'), $data); 57 | return response(true); 58 | } 59 | return response(false); 60 | }); 61 | }); 62 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | get()); 22 | dd($data); 23 | 24 | // return view('pdf.index', ['data' => $data->resource->toArray()]); 25 | 26 | // dd((LifeInsurance::inRandomOrder()->first())->birth_day); 27 | 28 | // return Excel::download(new LifeInsuranceExport(5), 'life-' . '5' . '.xlsx'); 29 | 30 | // $data = new LifeInsuranceResource(LifeInsurance::find(12)); 31 | // $pdf = SnappyPdf::loadView('pdf.index', ['data' => $data->resource->toArray()]); 32 | // return $pdf->inline('github.pdf'); 33 | }); 34 | 35 | Route::get('/{uri?}', function () { 36 | return view('welcome'); 37 | })->where('uri', '(.*)'); 38 | 39 | //$2y$10$1HTtUKUoX.Sp9wLfub/UqeJvP/pG8p4fMbRkjnxTRamMQEv.KOqKu 40 | //$2y$10$cEFYSWLYb2wZffPqpG/HJOnGt0fGpgHfungdM/3KRD1HnLLjZoWh. 41 | 42 | 43 | //6fac72b170b609bd7cbb3091f7d9f66d 44 | //6fac72b170b609bd7cbb3091f7d9f66d -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | --------------------------------------------------------------------------------