├── .editorconfig ├── .env.example ├── .eslintrc.js ├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── .php-cs-fixer.dist.php ├── .prettierrc ├── .styleci.yml ├── LICENSE ├── README.md ├── app ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ └── AuthenticatedSessionController.php │ │ ├── ContactsController.php │ │ ├── Controller.php │ │ ├── DashboardController.php │ │ ├── OrganizationsController.php │ │ └── ProfileController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── HandleInertiaRequests.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php │ └── Requests │ │ └── Auth │ │ └── LoginRequest.php ├── Models │ ├── Account.php │ ├── Contact.php │ ├── Organization.php │ └── User.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 ├── filesystems.php ├── hashing.php ├── inertia.php ├── logging.php ├── mail.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php ├── view.php └── vite.php ├── database ├── .gitignore ├── factories │ ├── ContactFactory.php │ ├── OrganizationFactory.php │ └── UserFactory.php ├── migrations │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2020_01_01_000001_create_password_resets_table.php │ ├── 2020_01_01_000002_create_failed_jobs_table.php │ ├── 2020_01_01_000003_create_accounts_table.php │ ├── 2020_01_01_000004_create_users_table.php │ ├── 2020_01_01_000005_create_organizations_table.php │ └── 2020_01_01_000006_create_contacts_table.php └── seeders │ └── DatabaseSeeder.php ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.svg ├── index.php ├── robots.txt └── web.config ├── resources ├── css │ ├── app.css │ ├── buttons.css │ ├── form.css │ └── reset.css ├── js │ ├── Pages │ │ ├── Auth │ │ │ └── Login.vue │ │ ├── Contacts │ │ │ ├── Create.vue │ │ │ ├── Edit.vue │ │ │ └── Index.vue │ │ ├── Dashboard │ │ │ └── Index.vue │ │ ├── Organizations │ │ │ ├── Create.vue │ │ │ ├── Edit.vue │ │ │ └── Index.vue │ │ └── Profile │ │ │ └── Show.vue │ ├── Plugins │ │ └── notifications.ts │ ├── Shared │ │ ├── Banner.vue │ │ ├── Dropdown.vue │ │ ├── FileInput.vue │ │ ├── Icon.vue │ │ ├── Layout.vue │ │ ├── LoadingButton.vue │ │ ├── Logo.vue │ │ ├── MainMenu.vue │ │ ├── Modal.vue │ │ ├── Pagination.vue │ │ ├── SearchFilter.vue │ │ ├── SelectInput.vue │ │ ├── Slideover.vue │ │ ├── TextInput.vue │ │ ├── TextareaInput.vue │ │ └── TrashedMessage.vue │ ├── app.ts │ ├── shims-inertia.d.ts │ ├── shims-vue.d.ts │ └── ssr.ts ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ └── app.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── screenshot.png ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── debugbar │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tailwind.config.js ├── tests ├── CreatesApplication.php ├── Feature │ ├── ContactsTest.php │ └── OrganizationsTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── tsconfig.json ├── vite.config.ssr.ts └── vite.config.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml,vue}] 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=sqlite 12 | #DB_HOST=127.0.0.1 13 | #DB_PORT=3306 14 | #DB_DATABASE=pingcrm 15 | #DB_USERNAME=root 16 | #DB_PASSWORD= 17 | 18 | BROADCAST_DRIVER=log 19 | CACHE_DRIVER=file 20 | FILESYSTEM_DRIVER=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=null 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_APP_CLUSTER=mt1 50 | 51 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 52 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 53 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['eslint:recommended', 'plugin:vue/vue3-recommended'], 3 | parserOptions: { 4 | ecmaVersion: 2020, 5 | sourceType: 'module', 6 | }, 7 | env: { 8 | amd: true, 9 | browser: true, 10 | es6: true, 11 | }, 12 | rules: { 13 | indent: ['error', 2], 14 | quotes: ['warn', 'single'], 15 | semi: ['warn', 'never'], 16 | 'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }], 17 | 'comma-dangle': ['warn', 'always-multiline'], 18 | 'vue/multi-word-component-names': 'off', 19 | 'vue/max-attributes-per-line': 'off', 20 | 'vue/no-v-html': 'off', 21 | 'vue/require-default-prop': 'off', 22 | 'vue/singleline-html-element-content-newline': 'off', 23 | 'vue/html-self-closing': [ 24 | 'warn', 25 | { 26 | html: { 27 | void: 'always', 28 | normal: 'always', 29 | component: 'always', 30 | }, 31 | }, 32 | ], 33 | }, 34 | } 35 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [reinink] 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/css 3 | /public/hot 4 | /public/js 5 | /public/mix-manifest.json 6 | /public/storage 7 | /storage/*.key 8 | /public/build 9 | /public/ssr 10 | /vendor 11 | .DS_Store 12 | .env 13 | .env.backup 14 | .phpunit.result.cache 15 | .php-cs-fixer.php 16 | .php-cs-fixer.cache 17 | docker-compose.override.yml 18 | Homestead.json 19 | Homestead.yaml 20 | npm-debug.log 21 | yarn-error.log 22 | package-lock.json 23 | yarn.lock 24 | /.idea 25 | /.vscode -------------------------------------------------------------------------------- /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | notPath('bootstrap') 5 | ->notPath('node_modules') 6 | ->notPath('storage') 7 | ->notPath('vendor') 8 | ->in(__DIR__) 9 | ->name('*.php') 10 | ->notName('*.blade.php'); 11 | 12 | return (new PhpCsFixer\Config()) 13 | ->setRiskyAllowed(true) 14 | ->setRules([ 15 | '@PSR2' => true, 16 | 'align_multiline_comment' => [ 17 | 'comment_type' => 'phpdocs_like', 18 | ], 19 | 'array_indentation' => true, 20 | 'array_syntax' => [ 21 | 'syntax' => 'short', 22 | ], 23 | 'binary_operator_spaces' => [ 24 | 'operators' => [ 25 | '=>' => null, 26 | '=' => 'single_space', 27 | ], 28 | ], 29 | 'blank_line_after_namespace' => true, 30 | 'blank_line_after_opening_tag' => true, 31 | 'blank_line_before_statement' => [ 32 | 'statements' => [ 33 | 'return', 34 | ], 35 | ], 36 | 'braces' => false, 37 | 'cast_spaces' => true, 38 | 'class_attributes_separation' => [ 39 | 'elements' => [ 40 | 'method' => 'one', 41 | ], 42 | ], 43 | 'class_definition' => false, 44 | 'clean_namespace' => true, 45 | 'compact_nullable_typehint' => true, 46 | 'concat_space' => [ 47 | 'spacing' => 'none', 48 | ], 49 | 'constant_case' => [ 50 | 'case' => 'lower', 51 | ], 52 | 'declare_equal_normalize' => true, 53 | 'elseif' => true, 54 | 'encoding' => true, 55 | 'full_opening_tag' => true, 56 | 'function_declaration' => true, 57 | 'function_typehint_space' => true, 58 | 'heredoc_to_nowdoc' => true, 59 | 'include' => true, 60 | 'increment_style' => [ 61 | 'style' => 'post', 62 | ], 63 | 'indentation_type' => true, 64 | 'integer_literal_case' => true, 65 | 'lambda_not_used_import' => true, 66 | 'line_ending' => true, 67 | 'list_syntax' => [ 68 | 'syntax' => 'short', 69 | ], 70 | 'lowercase_cast' => true, 71 | 'lowercase_keywords' => true, 72 | 'lowercase_static_reference' => true, 73 | 'magic_constant_casing' => true, 74 | 'magic_method_casing' => true, 75 | 'method_argument_space' => [ 76 | 'on_multiline' => 'ignore', 77 | ], 78 | 'multiline_whitespace_before_semicolons' => true, 79 | 'native_function_casing' => true, 80 | 'native_function_type_declaration_casing' => true, 81 | 'no_alias_language_construct_call' => true, 82 | 'no_alternative_syntax' => true, 83 | 'no_binary_string' => true, 84 | 'no_blank_lines_after_class_opening' => true, 85 | 'no_blank_lines_after_phpdoc' => true, 86 | 'no_closing_tag' => true, 87 | 'no_empty_phpdoc' => true, 88 | 'no_empty_statement' => true, 89 | 'no_extra_blank_lines' => [ 90 | 'tokens' => [ 91 | 'extra', 92 | 'throw', 93 | 'use', 94 | ], 95 | ], 96 | 'no_space_around_double_colon' => true, 97 | 'no_leading_import_slash' => true, 98 | 'no_leading_namespace_whitespace' => true, 99 | 'no_mixed_echo_print' => [ 100 | 'use' => 'echo', 101 | ], 102 | 'no_multiline_whitespace_around_double_arrow' => true, 103 | 'no_short_bool_cast' => true, 104 | 'no_singleline_whitespace_before_semicolons' => true, 105 | 'no_spaces_after_function_name' => true, 106 | 'no_spaces_around_offset' => [ 107 | 'positions' => [ 108 | 'inside', 109 | ], 110 | ], 111 | 'no_spaces_inside_parenthesis' => true, 112 | 'no_trailing_comma_in_list_call' => true, 113 | 'no_trailing_comma_in_singleline_array' => true, 114 | 'no_trailing_whitespace' => true, 115 | 'no_trailing_whitespace_in_comment' => true, 116 | 'no_unneeded_control_parentheses' => true, 117 | 'no_unneeded_curly_braces' => true, 118 | 'no_unset_cast' => true, 119 | 'no_unused_imports' => true, 120 | 'no_useless_return' => true, 121 | 'no_whitespace_before_comma_in_array' => true, 122 | 'no_whitespace_in_blank_line' => true, 123 | 'normalize_index_brace' => true, 124 | 'not_operator_with_successor_space' => true, 125 | 'object_operator_without_whitespace' => true, 126 | 'ordered_imports' => [ 127 | 'sort_algorithm' => 'alpha', 128 | ], 129 | 'phpdoc_indent' => true, 130 | 'phpdoc_inline_tag_normalizer' => true, 131 | 'phpdoc_no_alias_tag' => [ 132 | 'replacements' => [ 133 | 'type' => 'var', 134 | ], 135 | ], 136 | 'phpdoc_no_access' => true, 137 | 'phpdoc_no_package' => true, 138 | 'phpdoc_no_useless_inheritdoc' => true, 139 | 'phpdoc_return_self_reference' => true, 140 | 'phpdoc_scalar' => true, 141 | 'phpdoc_single_line_var_spacing' => true, 142 | 'phpdoc_summary' => true, 143 | 'phpdoc_trim' => true, 144 | 'phpdoc_types' => true, 145 | 'phpdoc_var_without_name' => true, 146 | 'return_type_declaration' => [ 147 | 'space_before' => 'none', 148 | ], 149 | 'short_scalar_cast' => true, 150 | 'single_blank_line_at_eof' => true, 151 | 'single_blank_line_before_namespace' => true, 152 | 'single_class_element_per_statement' => true, 153 | 'single_import_per_statement' => true, 154 | 'single_line_after_imports' => true, 155 | 'single_line_comment_style' => [ 156 | 'comment_types' => [ 157 | 'hash', 158 | ], 159 | ], 160 | 'single_quote' => true, 161 | 'space_after_semicolon' => true, 162 | 'standardize_not_equals' => true, 163 | 'switch_case_semicolon_to_colon' => true, 164 | 'switch_case_space' => true, 165 | 'switch_continue_to_break' => true, 166 | 'ternary_operator_spaces' => true, 167 | 'trailing_comma_in_multiline' => [ 168 | 'elements' => [ 169 | 'arrays', 170 | ], 171 | ], 172 | 'trim_array_spaces' => true, 173 | 'types_spaces' => [ 174 | 'space' => 'none', 175 | ], 176 | 'unary_operator_spaces' => true, 177 | 'visibility_required' => [ 178 | 'elements' => [ 179 | 'method', 180 | 'property', 181 | ], 182 | ], 183 | 'whitespace_after_comma_in_array' => true, 184 | // Risky 185 | 'no_alias_functions' => true, 186 | 'no_unreachable_default_argument_value' => true, 187 | 'self_accessor' => true, 188 | 'psr_autoloading' => true, 189 | ]) 190 | ->setFinder($finder); 191 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "semi": false, 4 | "bracketSameLine": true, 5 | "printWidth": 120, 6 | "singleAttributePerLine": false 7 | } 8 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | version: 8 4 | disabled: 5 | - no_unused_imports 6 | finder: 7 | not-name: 8 | - index.php 9 | - server.php 10 | js: 11 | finder: 12 | not-name: 13 | - webpack.mix.js 14 | css: true 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Boris Lepikhin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ping CRM 2 | 3 | A demo application to illustrate how Inertia.js works. 4 | 5 | ![](https://raw.githubusercontent.com/lepikhinb/momentum-modal-example/master/screenshot.png) 6 | 7 | ## Installation 8 | 9 | Clone the repo locally: 10 | 11 | ```sh 12 | git clone https://github.com/lepikhinb/momentum-modal-example.git momentum-modal 13 | cd pingcrm 14 | ``` 15 | 16 | Install PHP dependencies: 17 | 18 | ```sh 19 | composer install 20 | ``` 21 | 22 | Install NPM dependencies: 23 | 24 | ```sh 25 | npm ci 26 | ``` 27 | 28 | Build assets: 29 | 30 | ```sh 31 | npm run dev 32 | ``` 33 | 34 | Setup configuration: 35 | 36 | ```sh 37 | cp .env.example .env 38 | ``` 39 | 40 | Generate application key: 41 | 42 | ```sh 43 | php artisan key:generate 44 | ``` 45 | 46 | Create an SQLite database. You can also use another database (MySQL, Postgres), simply update your configuration accordingly. 47 | 48 | ```sh 49 | touch database/database.sqlite 50 | ``` 51 | 52 | Run database migrations: 53 | 54 | ```sh 55 | php artisan migrate 56 | ``` 57 | 58 | Run database seeder: 59 | 60 | ```sh 61 | php artisan db:seed 62 | ``` 63 | 64 | Run the dev server (the output will give the address): 65 | 66 | ```sh 67 | php artisan inertia:start-ssr 68 | ``` 69 | 70 | You're ready to go! Visit Ping CRM in your browser, and login with: 71 | 72 | - **Username:** johndoe@example.com 73 | - **Password:** secret 74 | 75 | ## Running tests 76 | 77 | To run the Ping CRM tests, run: 78 | 79 | ``` 80 | phpunit 81 | ``` 82 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('migrate:fresh --seed --force')->hourly(); 19 | } 20 | 21 | /** 22 | * Register the commands for the application. 23 | * 24 | * @return void 25 | */ 26 | protected function commands() 27 | { 28 | $this->load(__DIR__ . '/Commands'); 29 | 30 | require base_path('routes/console.php'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | > 14 | */ 15 | protected $dontReport = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the inputs that are never flashed for validation exceptions. 21 | * 22 | * @var array 23 | */ 24 | protected $dontFlash = [ 25 | 'current_password', 26 | 'password', 27 | 'password_confirmation', 28 | ]; 29 | 30 | /** 31 | * Register the exception handling callbacks for the application. 32 | * 33 | * @return void 34 | */ 35 | public function register() 36 | { 37 | $this->reportable(function (Throwable $e) { 38 | // 39 | }); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthenticatedSessionController.php: -------------------------------------------------------------------------------- 1 | authenticate(); 32 | 33 | $request->session()->regenerate(); 34 | 35 | return redirect()->intended(RouteServiceProvider::HOME); 36 | } 37 | 38 | /** 39 | * Destroy an authenticated session. 40 | * 41 | * @return \Illuminate\Http\RedirectResponse 42 | */ 43 | public function destroy(Request $request) 44 | { 45 | Auth::guard('web')->logout(); 46 | 47 | $request->session()->invalidate(); 48 | 49 | $request->session()->regenerateToken(); 50 | 51 | return redirect('/'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Http/Controllers/ContactsController.php: -------------------------------------------------------------------------------- 1 | Request::all('search', 'trashed'), 18 | 'contacts' => Auth::user()->account->contacts() 19 | ->with('organization') 20 | ->orderByName() 21 | ->filter(Request::only('search', 'trashed')) 22 | ->paginate(10) 23 | ->withQueryString() 24 | ->through(fn ($contact) => [ 25 | 'id' => $contact->id, 26 | 'name' => $contact->name, 27 | 'phone' => $contact->phone, 28 | 'city' => $contact->city, 29 | 'deleted_at' => $contact->deleted_at, 30 | 'organization' => $contact->organization ? $contact->organization->only('name') : null, 31 | ]), 32 | ]); 33 | } 34 | 35 | public function create() 36 | { 37 | return Inertia::modal('Contacts/Create') 38 | ->with([ 39 | 'organizations' => Auth::user()->account 40 | ->organizations() 41 | ->orderBy('name') 42 | ->get() 43 | ->map 44 | ->only('id', 'name'), 45 | ]) 46 | ->baseRoute('contacts'); 47 | } 48 | 49 | public function store() 50 | { 51 | Auth::user()->account->contacts()->create( 52 | Request::validate([ 53 | 'first_name' => ['required', 'max:50'], 54 | 'last_name' => ['required', 'max:50'], 55 | 'organization_id' => ['nullable', Rule::exists('organizations', 'id')->where(function ($query) { 56 | $query->where('account_id', Auth::user()->account_id); 57 | })], 58 | 'email' => ['nullable', 'max:50', 'email'], 59 | 'phone' => ['nullable', 'max:50'], 60 | 'address' => ['nullable', 'max:150'], 61 | 'city' => ['nullable', 'max:50'], 62 | 'region' => ['nullable', 'max:50'], 63 | 'country' => ['nullable', 'max:2'], 64 | 'postal_code' => ['nullable', 'max:25'], 65 | ]) 66 | ); 67 | 68 | return Redirect::route('contacts')->with('success', 'Contact created.'); 69 | } 70 | 71 | public function edit(Contact $contact) 72 | { 73 | return Inertia::modal('Contacts/Edit') 74 | ->with([ 75 | 'contact' => [ 76 | 'id' => $contact->id, 77 | 'first_name' => $contact->first_name, 78 | 'last_name' => $contact->last_name, 79 | 'organization_id' => $contact->organization_id, 80 | 'email' => $contact->email, 81 | 'phone' => $contact->phone, 82 | 'address' => $contact->address, 83 | 'city' => $contact->city, 84 | 'region' => $contact->region, 85 | 'country' => $contact->country, 86 | 'postal_code' => $contact->postal_code, 87 | 'deleted_at' => $contact->deleted_at, 88 | ], 89 | 'organizations' => Auth::user()->account->organizations() 90 | ->orderBy('name') 91 | ->get() 92 | ->map 93 | ->only('id', 'name'), 94 | ]) 95 | ->baseRoute('contacts'); 96 | } 97 | 98 | public function update(Contact $contact) 99 | { 100 | $contact->update( 101 | Request::validate([ 102 | 'first_name' => ['required', 'max:50'], 103 | 'last_name' => ['required', 'max:50'], 104 | 'organization_id' => [ 105 | 'nullable', 106 | Rule::exists('organizations', 'id')->where(fn ($query) => $query->where('account_id', Auth::user()->account_id)), 107 | ], 108 | 'email' => ['nullable', 'max:50', 'email'], 109 | 'phone' => ['nullable', 'max:50'], 110 | 'address' => ['nullable', 'max:150'], 111 | 'city' => ['nullable', 'max:50'], 112 | 'region' => ['nullable', 'max:50'], 113 | 'country' => ['nullable', 'max:2'], 114 | 'postal_code' => ['nullable', 'max:25'], 115 | ]) 116 | ); 117 | 118 | return Redirect::back()->with('success', 'Contact updated.'); 119 | } 120 | 121 | public function destroy(Contact $contact) 122 | { 123 | $contact->delete(); 124 | 125 | return Redirect::back()->with('success', 'Contact deleted.'); 126 | } 127 | 128 | public function restore(Contact $contact) 129 | { 130 | $contact->restore(); 131 | 132 | return Redirect::back()->with('success', 'Contact restored.'); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | Request::all('search', 'trashed'), 17 | 'organizations' => Auth::user()->account->organizations() 18 | ->orderBy('name') 19 | ->filter(Request::only('search', 'trashed')) 20 | ->paginate(10) 21 | ->withQueryString() 22 | ->through(fn ($organization) => [ 23 | 'id' => $organization->id, 24 | 'name' => $organization->name, 25 | 'phone' => $organization->phone, 26 | 'city' => $organization->city, 27 | 'deleted_at' => $organization->deleted_at, 28 | ]), 29 | ]); 30 | } 31 | 32 | public function create() 33 | { 34 | return Inertia::modal('Organizations/Create') 35 | ->baseRoute('organizations'); 36 | } 37 | 38 | public function store() 39 | { 40 | Auth::user()->account->organizations()->create( 41 | Request::validate([ 42 | 'name' => ['required', 'max:100'], 43 | 'email' => ['nullable', 'max:50', 'email'], 44 | 'phone' => ['nullable', 'max:50'], 45 | 'address' => ['nullable', 'max:150'], 46 | 'city' => ['nullable', 'max:50'], 47 | 'region' => ['nullable', 'max:50'], 48 | 'country' => ['nullable', 'max:2'], 49 | 'postal_code' => ['nullable', 'max:25'], 50 | ]) 51 | ); 52 | 53 | return Redirect::route('organizations')->with('success', 'Organization created.'); 54 | } 55 | 56 | public function edit(Organization $organization) 57 | { 58 | return Inertia::modal('Organizations/Edit', [ 59 | 'organization' => [ 60 | 'id' => $organization->id, 61 | 'name' => $organization->name, 62 | 'email' => $organization->email, 63 | 'phone' => $organization->phone, 64 | 'address' => $organization->address, 65 | 'city' => $organization->city, 66 | 'region' => $organization->region, 67 | 'country' => $organization->country, 68 | 'postal_code' => $organization->postal_code, 69 | 'deleted_at' => $organization->deleted_at, 70 | 'contacts' => $organization->contacts()->orderByName()->get()->map->only('id', 'name', 'city', 'phone'), 71 | ], 72 | ]) 73 | ->baseRoute('organizations'); 74 | } 75 | 76 | public function update(Organization $organization) 77 | { 78 | $organization->update( 79 | Request::validate([ 80 | 'name' => ['required', 'max:100'], 81 | 'email' => ['nullable', 'max:50', 'email'], 82 | 'phone' => ['nullable', 'max:50'], 83 | 'address' => ['nullable', 'max:150'], 84 | 'city' => ['nullable', 'max:50'], 85 | 'region' => ['nullable', 'max:50'], 86 | 'country' => ['nullable', 'max:2'], 87 | 'postal_code' => ['nullable', 'max:25'], 88 | ]) 89 | ); 90 | 91 | return Redirect::back()->with('success', 'Organization updated.'); 92 | } 93 | 94 | public function destroy(Organization $organization) 95 | { 96 | $organization->delete(); 97 | 98 | return Redirect::back()->with('success', 'Organization deleted.'); 99 | } 100 | 101 | public function restore(Organization $organization) 102 | { 103 | $organization->restore(); 104 | 105 | return Redirect::back()->with('success', 'Organization restored.'); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /app/Http/Controllers/ProfileController.php: -------------------------------------------------------------------------------- 1 | user(); 19 | 20 | return Inertia::modal('Profile/Show') 21 | ->with([ 22 | 'user' => [ 23 | 'id' => $user->id, 24 | 'first_name' => $user->first_name, 25 | 'last_name' => $user->last_name, 26 | 'email' => $user->email, 27 | 'deleted_at' => $user->deleted_at, 28 | ], 29 | ]) 30 | ->baseRoute('dashboard'); 31 | } 32 | 33 | public function update() 34 | { 35 | /** @var \App\Models\User */ 36 | $user = auth()->user(); 37 | 38 | if (App::environment('demo') && $user->isDemoUser()) { 39 | return Redirect::back()->with('error', 'Updating the demo user is not allowed.'); 40 | } 41 | 42 | Request::validate([ 43 | 'first_name' => ['required', 'max:50'], 44 | 'last_name' => ['required', 'max:50'], 45 | 'email' => ['required', 'max:50', 'email', Rule::unique('users')->ignore($user->id)], 46 | 'password' => ['nullable'], 47 | ]); 48 | 49 | $user->update(Request::only('first_name', 'last_name', 'email')); 50 | 51 | return Redirect::back()->with('success', 'User updated.'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Fruitcake\Cors\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\Session\Middleware\AuthenticateSession::class, 37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 38 | \App\Http\Middleware\VerifyCsrfToken::class, 39 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 40 | \App\Http\Middleware\HandleInertiaRequests::class, 41 | ], 42 | 43 | 'api' => [ 44 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 45 | 'throttle:api', 46 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 47 | ], 48 | ]; 49 | 50 | /** 51 | * The application's route middleware. 52 | * 53 | * These middleware may be assigned to groups or used individually. 54 | * 55 | * @var array 56 | */ 57 | protected $routeMiddleware = [ 58 | 'auth' => \App\Http\Middleware\Authenticate::class, 59 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 60 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 61 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 62 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 63 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 64 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 65 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 66 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 67 | ]; 68 | } 69 | -------------------------------------------------------------------------------- /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/HandleInertiaRequests.php: -------------------------------------------------------------------------------- 1 | function () use ($request) { 41 | return [ 42 | 'user' => $request->user() ? [ 43 | 'id' => $request->user()->id, 44 | 'first_name' => $request->user()->first_name, 45 | 'last_name' => $request->user()->last_name, 46 | 'email' => $request->user()->email, 47 | 'owner' => $request->user()->owner, 48 | 'account' => [ 49 | 'id' => $request->user()->account->id, 50 | 'name' => $request->user()->account->name, 51 | ], 52 | ] : null, 53 | ]; 54 | }, 55 | 'flash' => function () use ($request) { 56 | return [ 57 | 'success' => $request->session()->get('success'), 58 | 'error' => $request->session()->get('error'), 59 | ]; 60 | }, 61 | ]); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /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/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Requests/Auth/LoginRequest.php: -------------------------------------------------------------------------------- 1 | 'required|string|email', 33 | 'password' => 'required|string', 34 | ]; 35 | } 36 | 37 | /** 38 | * Attempt to authenticate the request's credentials. 39 | * 40 | * @return void 41 | * 42 | * @throws \Illuminate\Validation\ValidationException 43 | */ 44 | public function authenticate() 45 | { 46 | $this->ensureIsNotRateLimited(); 47 | 48 | if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) { 49 | RateLimiter::hit($this->throttleKey()); 50 | 51 | throw ValidationException::withMessages([ 52 | 'email' => __('auth.failed'), 53 | ]); 54 | } 55 | 56 | RateLimiter::clear($this->throttleKey()); 57 | } 58 | 59 | /** 60 | * Ensure the login request is not rate limited. 61 | * 62 | * @return void 63 | * 64 | * @throws \Illuminate\Validation\ValidationException 65 | */ 66 | public function ensureIsNotRateLimited() 67 | { 68 | if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { 69 | return; 70 | } 71 | 72 | event(new Lockout($this)); 73 | 74 | $seconds = RateLimiter::availableIn($this->throttleKey()); 75 | 76 | throw ValidationException::withMessages([ 77 | 'email' => trans('auth.throttle', [ 78 | 'seconds' => $seconds, 79 | 'minutes' => ceil($seconds / 60), 80 | ]), 81 | ]); 82 | } 83 | 84 | /** 85 | * Get the rate limiting throttle key for the request. 86 | * 87 | * @return string 88 | */ 89 | public function throttleKey() 90 | { 91 | return Str::lower($this->input('email')).'|'.$this->ip(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /app/Models/Account.php: -------------------------------------------------------------------------------- 1 | hasMany(User::class); 12 | } 13 | 14 | public function organizations() 15 | { 16 | return $this->hasMany(Organization::class); 17 | } 18 | 19 | public function contacts() 20 | { 21 | return $this->hasMany(Contact::class); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Models/Contact.php: -------------------------------------------------------------------------------- 1 | where($field ?? 'id', $value)->withTrashed()->firstOrFail(); 17 | } 18 | 19 | public function organization() 20 | { 21 | return $this->belongsTo(Organization::class); 22 | } 23 | 24 | public function getNameAttribute() 25 | { 26 | return $this->first_name.' '.$this->last_name; 27 | } 28 | 29 | public function scopeOrderByName($query) 30 | { 31 | $query->orderBy('last_name')->orderBy('first_name'); 32 | } 33 | 34 | public function scopeFilter($query, array $filters) 35 | { 36 | $query->when($filters['search'] ?? null, function ($query, $search) { 37 | $query->where(function ($query) use ($search) { 38 | $query->where('first_name', 'like', '%'.$search.'%') 39 | ->orWhere('last_name', 'like', '%'.$search.'%') 40 | ->orWhere('email', 'like', '%'.$search.'%') 41 | ->orWhereHas('organization', function ($query) use ($search) { 42 | $query->where('name', 'like', '%'.$search.'%'); 43 | }); 44 | }); 45 | })->when($filters['trashed'] ?? null, function ($query, $trashed) { 46 | if ($trashed === 'with') { 47 | $query->withTrashed(); 48 | } elseif ($trashed === 'only') { 49 | $query->onlyTrashed(); 50 | } 51 | }); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Models/Organization.php: -------------------------------------------------------------------------------- 1 | where($field ?? 'id', $value)->withTrashed()->firstOrFail(); 17 | } 18 | 19 | public function contacts() 20 | { 21 | return $this->hasMany(Contact::class); 22 | } 23 | 24 | public function scopeFilter($query, array $filters) 25 | { 26 | $query->when($filters['search'] ?? null, function ($query, $search) { 27 | $query->where('name', 'like', '%'.$search.'%'); 28 | })->when($filters['trashed'] ?? null, function ($query, $trashed) { 29 | if ($trashed === 'with') { 30 | $query->withTrashed(); 31 | } elseif ($trashed === 'only') { 32 | $query->onlyTrashed(); 33 | } 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | protected $fillable = [ 22 | 'name', 23 | 'email', 24 | 'password', 25 | ]; 26 | 27 | /** 28 | * The attributes that should be hidden for serialization. 29 | * 30 | * @var array 31 | */ 32 | protected $hidden = [ 33 | 'password', 34 | 'remember_token', 35 | ]; 36 | 37 | /** 38 | * The attributes that should be cast. 39 | * 40 | * @var array 41 | */ 42 | protected $casts = [ 43 | 'email_verified_at' => 'datetime', 44 | ]; 45 | 46 | public function resolveRouteBinding($value, $field = null) 47 | { 48 | return $this->where($field ?? 'id', $value)->withTrashed()->firstOrFail(); 49 | } 50 | 51 | public function account() 52 | { 53 | return $this->belongsTo(Account::class); 54 | } 55 | 56 | public function getNameAttribute() 57 | { 58 | return $this->first_name . ' ' . $this->last_name; 59 | } 60 | 61 | public function setPasswordAttribute($password) 62 | { 63 | $this->attributes['password'] = Hash::needsRehash($password) ? Hash::make($password) : $password; 64 | } 65 | 66 | public function isDemoUser() 67 | { 68 | return $this->email === 'johndoe@example.com'; 69 | } 70 | 71 | public function scopeOrderByName($query) 72 | { 73 | $query->orderBy('last_name')->orderBy('first_name'); 74 | } 75 | 76 | public function scopeWhereRole($query, $role) 77 | { 78 | switch ($role) { 79 | case 'user': 80 | return $query->where('owner', false); 81 | case 'owner': 82 | return $query->where('owner', true); 83 | } 84 | } 85 | 86 | public function scopeFilter($query, array $filters) 87 | { 88 | $query->when($filters['search'] ?? null, function ($query, $search) { 89 | $query->where(function ($query) use ($search) { 90 | $query->where('first_name', 'like', '%' . $search . '%') 91 | ->orWhere('last_name', 'like', '%' . $search . '%') 92 | ->orWhere('email', 'like', '%' . $search . '%'); 93 | }); 94 | })->when($filters['role'] ?? null, function ($query, $role) { 95 | $query->whereRole($role); 96 | })->when($filters['trashed'] ?? null, function ($query, $trashed) { 97 | if ($trashed === 'with') { 98 | $query->withTrashed(); 99 | } elseif ($trashed === 'only') { 100 | $query->onlyTrashed(); 101 | } 102 | }); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $policies = [ 15 | // 'App\Models\Model' => 'App\Policies\ModelPolicy', 16 | ]; 17 | 18 | /** 19 | * Register any authentication / authorization services. 20 | * 21 | * @return void 22 | */ 23 | public function boot() 24 | { 25 | $this->registerPolicies(); 26 | 27 | // 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 39 | 40 | $this->routes(function () { 41 | Route::prefix('api') 42 | ->middleware('api') 43 | ->namespace($this->namespace) 44 | ->group(base_path('routes/api.php')); 45 | 46 | Route::middleware('web') 47 | ->namespace($this->namespace) 48 | ->group(base_path('routes/web.php')); 49 | }); 50 | } 51 | 52 | /** 53 | * Configure the rate limiters for the application. 54 | * 55 | * @return void 56 | */ 57 | protected function configureRateLimiting() 58 | { 59 | RateLimiter::for('api', function (Request $request) { 60 | return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); 61 | }); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /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": "lepikhinb/pingcrm", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.4|^8.0", 12 | "ext-exif": "*", 13 | "ext-gd": "*", 14 | "based/momentum-modal": "^0.2.0", 15 | "fruitcake/laravel-cors": "^2.0", 16 | "guzzlehttp/guzzle": "^7.0.1", 17 | "inertiajs/inertia-laravel": "^0.6.9", 18 | "innocenzi/laravel-vite": "0.2.*", 19 | "laravel/framework": "^8.65", 20 | "laravel/sanctum": "^2.11", 21 | "laravel/tinker": "^2.5", 22 | "league/glide-laravel": "^1.0" 23 | }, 24 | "require-dev": { 25 | "roave/security-advisories": "dev-latest", 26 | "facade/ignition": "^2.5", 27 | "fakerphp/faker": "^1.9.1", 28 | "laravel/sail": "^1.0.1", 29 | "mockery/mockery": "^1.4.4", 30 | "nunomaduro/collision": "^5.10", 31 | "phpunit/phpunit": "^9.5.10" 32 | }, 33 | "autoload": { 34 | "psr-4": { 35 | "App\\": "app/", 36 | "Database\\Factories\\": "database/factories/", 37 | "Database\\Seeders\\": "database/seeders/" 38 | } 39 | }, 40 | "autoload-dev": { 41 | "psr-4": { 42 | "Tests\\": "tests/" 43 | } 44 | }, 45 | "scripts": { 46 | "post-autoload-dump": [ 47 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 48 | "@php artisan package:discover --ansi" 49 | ], 50 | "post-update-cmd": [ 51 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force" 52 | ], 53 | "post-root-package-install": [ 54 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 55 | ], 56 | "post-create-project-cmd": [ 57 | "@php artisan key:generate --ansi" 58 | ], 59 | "compile": [ 60 | "@php artisan migrate:fresh --seed" 61 | ] 62 | }, 63 | "extra": { 64 | "laravel": { 65 | "dont-discover": [] 66 | } 67 | }, 68 | "config": { 69 | "optimize-autoloader": true, 70 | "preferred-install": "dist", 71 | "sort-packages": true 72 | }, 73 | "minimum-stability": "dev", 74 | "prefer-stable": true 75 | } 76 | -------------------------------------------------------------------------------- /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 the reset token should 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 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | ], 43 | 44 | 'ably' => [ 45 | 'driver' => 'ably', 46 | 'key' => env('ABLY_KEY'), 47 | ], 48 | 49 | 'redis' => [ 50 | 'driver' => 'redis', 51 | 'connection' => 'default', 52 | ], 53 | 54 | 'log' => [ 55 | 'driver' => 'log', 56 | ], 57 | 58 | 'null' => [ 59 | 'driver' => 'null', 60 | ], 61 | 62 | ], 63 | 64 | ]; 65 | -------------------------------------------------------------------------------- /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 a RAM based store such as APC or Memcached, there might 103 | | be other applications utilizing the same cache. So, we'll specify a 104 | | value to get prefixed to all our keys so we can 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/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Database Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here are each of the database connections setup for your application. 26 | | Of course, examples of configuring each database platform that is 27 | | supported by Laravel is shown below to make development simple. 28 | | 29 | | 30 | | All database work in Laravel is done through the PHP PDO facilities 31 | | so make sure you have the driver for your particular database of 32 | | choice installed on your machine before you begin development. 33 | | 34 | */ 35 | 36 | 'connections' => [ 37 | 38 | 'sqlite' => [ 39 | 'driver' => 'sqlite', 40 | 'url' => env('DATABASE_URL'), 41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 42 | 'prefix' => '', 43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 44 | ], 45 | 46 | 'mysql' => [ 47 | 'driver' => 'mysql', 48 | 'url' => env('DATABASE_URL'), 49 | 'host' => env('DB_HOST', '127.0.0.1'), 50 | 'port' => env('DB_PORT', '3306'), 51 | 'database' => env('DB_DATABASE', 'forge'), 52 | 'username' => env('DB_USERNAME', 'forge'), 53 | 'password' => env('DB_PASSWORD', ''), 54 | 'unix_socket' => env('DB_SOCKET', ''), 55 | 'charset' => 'utf8mb4', 56 | 'collation' => 'utf8mb4_unicode_ci', 57 | 'prefix' => '', 58 | 'prefix_indexes' => true, 59 | 'strict' => true, 60 | 'engine' => null, 61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 63 | ]) : [], 64 | ], 65 | 66 | 'pgsql' => [ 67 | 'driver' => 'pgsql', 68 | 'url' => env('DATABASE_URL'), 69 | 'host' => env('DB_HOST', '127.0.0.1'), 70 | 'port' => env('DB_PORT', '5432'), 71 | 'database' => env('DB_DATABASE', 'forge'), 72 | 'username' => env('DB_USERNAME', 'forge'), 73 | 'password' => env('DB_PASSWORD', ''), 74 | 'charset' => 'utf8', 75 | 'prefix' => '', 76 | 'prefix_indexes' => true, 77 | 'schema' => 'public', 78 | 'sslmode' => 'prefer', 79 | ], 80 | 81 | 'sqlsrv' => [ 82 | 'driver' => 'sqlsrv', 83 | 'url' => env('DATABASE_URL'), 84 | 'host' => env('DB_HOST', 'localhost'), 85 | 'port' => env('DB_PORT', '1433'), 86 | 'database' => env('DB_DATABASE', 'forge'), 87 | 'username' => env('DB_USERNAME', 'forge'), 88 | 'password' => env('DB_PASSWORD', ''), 89 | 'charset' => 'utf8', 90 | 'prefix' => '', 91 | 'prefix_indexes' => true, 92 | ], 93 | 94 | ], 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Migration Repository Table 99 | |-------------------------------------------------------------------------- 100 | | 101 | | This table keeps track of all the migrations that have already run for 102 | | your application. Using this information, we can determine which of 103 | | the migrations on disk haven't actually been run in the database. 104 | | 105 | */ 106 | 107 | 'migrations' => 'migrations', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Redis Databases 112 | |-------------------------------------------------------------------------- 113 | | 114 | | Redis is an open source, fast, and advanced key-value store that also 115 | | provides a richer body of commands than a typical key-value system 116 | | such as APC or Memcached. Laravel makes it easy to dig right in. 117 | | 118 | */ 119 | 120 | 'redis' => [ 121 | 122 | 'client' => env('REDIS_CLIENT', 'phpredis'), 123 | 124 | 'options' => [ 125 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 126 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 127 | ], 128 | 129 | 'default' => [ 130 | 'url' => env('REDIS_URL'), 131 | 'host' => env('REDIS_HOST', '127.0.0.1'), 132 | 'password' => env('REDIS_PASSWORD', null), 133 | 'port' => env('REDIS_PORT', '6379'), 134 | 'database' => env('REDIS_DB', '0'), 135 | ], 136 | 137 | 'cache' => [ 138 | 'url' => env('REDIS_URL'), 139 | 'host' => env('REDIS_HOST', '127.0.0.1'), 140 | 'password' => env('REDIS_PASSWORD', null), 141 | 'port' => env('REDIS_PORT', '6379'), 142 | 'database' => env('REDIS_CACHE_DB', '1'), 143 | ], 144 | 145 | ], 146 | 147 | ]; 148 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', '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 setup for each driver as an example of the required options. 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 | ], 37 | 38 | 'public' => [ 39 | 'driver' => 'local', 40 | 'root' => storage_path('app/public'), 41 | 'url' => env('APP_URL').'/storage', 42 | 'visibility' => 'public', 43 | ], 44 | 45 | 's3' => [ 46 | 'driver' => 's3', 47 | 'key' => env('AWS_ACCESS_KEY_ID'), 48 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 49 | 'region' => env('AWS_DEFAULT_REGION'), 50 | 'bucket' => env('AWS_BUCKET'), 51 | 'url' => env('AWS_URL'), 52 | 'endpoint' => env('AWS_ENDPOINT'), 53 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 54 | ], 55 | 56 | ], 57 | 58 | /* 59 | |-------------------------------------------------------------------------- 60 | | Symbolic Links 61 | |-------------------------------------------------------------------------- 62 | | 63 | | Here you may configure the symbolic links that will be created when the 64 | | `storage:link` Artisan command is executed. The array keys should be 65 | | the locations of the links and the values should be their targets. 66 | | 67 | */ 68 | 69 | 'links' => [ 70 | public_path('storage') => storage_path('app/public'), 71 | ], 72 | 73 | ]; 74 | -------------------------------------------------------------------------------- /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' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/inertia.php: -------------------------------------------------------------------------------- 1 | [ 20 | 21 | 'enabled' => true, 22 | 23 | 'url' => 'http://127.0.0.1:13714/render', 24 | 25 | 'bundle' => base_path('public/ssr/ssr.mjs'), 26 | ], 27 | 28 | /* 29 | |-------------------------------------------------------------------------- 30 | | Testing 31 | |-------------------------------------------------------------------------- 32 | | 33 | | The values described here are used to locate Inertia components on the 34 | | filesystem. For instance, when using `assertInertia`, the assertion 35 | | attempts to locate the component as a file relative to any of the 36 | | paths AND with any of the extensions specified here. 37 | | 38 | */ 39 | 40 | 'testing' => [ 41 | 42 | 'ensure_pages_exist' => true, 43 | 44 | 'page_paths' => [ 45 | 46 | resource_path('js/Pages'), 47 | 48 | ], 49 | 50 | 'page_extensions' => [ 51 | 52 | 'js', 53 | 'jsx', 54 | 'svelte', 55 | 'ts', 56 | 'tsx', 57 | 'vue', 58 | 59 | ], 60 | 61 | ], 62 | 63 | ]; 64 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Deprecations Log Channel 25 | |-------------------------------------------------------------------------- 26 | | 27 | | This option controls the log channel that should be used to log warnings 28 | | regarding deprecated PHP and library features. This allows you to get 29 | | your application ready for upcoming major versions of dependencies. 30 | | 31 | */ 32 | 33 | 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Log Channels 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may configure the log channels for your application. Out of 41 | | the box, Laravel uses the Monolog PHP logging library. This gives 42 | | you a variety of powerful log handlers / formatters to utilize. 43 | | 44 | | Available Drivers: "single", "daily", "slack", "syslog", 45 | | "errorlog", "monolog", 46 | | "custom", "stack" 47 | | 48 | */ 49 | 50 | 'channels' => [ 51 | 'stack' => [ 52 | 'driver' => 'stack', 53 | 'channels' => ['single'], 54 | 'ignore_exceptions' => false, 55 | ], 56 | 57 | 'single' => [ 58 | 'driver' => 'single', 59 | 'path' => storage_path('logs/laravel.log'), 60 | 'level' => env('LOG_LEVEL', 'debug'), 61 | ], 62 | 63 | 'daily' => [ 64 | 'driver' => 'daily', 65 | 'path' => storage_path('logs/laravel.log'), 66 | 'level' => env('LOG_LEVEL', 'debug'), 67 | 'days' => 14, 68 | ], 69 | 70 | 'slack' => [ 71 | 'driver' => 'slack', 72 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 73 | 'username' => 'Laravel Log', 74 | 'emoji' => ':boom:', 75 | 'level' => env('LOG_LEVEL', 'critical'), 76 | ], 77 | 78 | 'papertrail' => [ 79 | 'driver' => 'monolog', 80 | 'level' => env('LOG_LEVEL', 'debug'), 81 | 'handler' => SyslogUdpHandler::class, 82 | 'handler_with' => [ 83 | 'host' => env('PAPERTRAIL_URL'), 84 | 'port' => env('PAPERTRAIL_PORT'), 85 | ], 86 | ], 87 | 88 | 'stderr' => [ 89 | 'driver' => 'monolog', 90 | 'level' => env('LOG_LEVEL', 'debug'), 91 | 'handler' => StreamHandler::class, 92 | 'formatter' => env('LOG_STDERR_FORMATTER'), 93 | 'with' => [ 94 | 'stream' => 'php://stderr', 95 | ], 96 | ], 97 | 98 | 'syslog' => [ 99 | 'driver' => 'syslog', 100 | 'level' => env('LOG_LEVEL', 'debug'), 101 | ], 102 | 103 | 'errorlog' => [ 104 | 'driver' => 'errorlog', 105 | 'level' => env('LOG_LEVEL', 'debug'), 106 | ], 107 | 108 | 'null' => [ 109 | 'driver' => 'monolog', 110 | 'handler' => NullHandler::class, 111 | ], 112 | 113 | 'emergency' => [ 114 | 'path' => storage_path('logs/laravel.log'), 115 | ], 116 | ], 117 | 118 | ]; 119 | -------------------------------------------------------------------------------- /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 | 'auth_mode' => null, 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 -t -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( 17 | '%s%s', 18 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 19 | env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : '' 20 | ))), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Sanctum Guards 25 | |-------------------------------------------------------------------------- 26 | | 27 | | This array contains the authentication guards that will be checked when 28 | | Sanctum is trying to authenticate a request. If none of these guards 29 | | are able to authenticate the request, Sanctum will use the bearer 30 | | token that's present on an incoming request for authentication. 31 | | 32 | */ 33 | 34 | 'guard' => ['web'], 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Expiration Minutes 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This value controls the number of minutes until an issued token will be 42 | | considered expired. If this value is null, personal access tokens do 43 | | not expire. This won't tweak the lifetime of first-party sessions. 44 | | 45 | */ 46 | 47 | 'expiration' => null, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Sanctum Middleware 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When authenticating your first-party SPA with Sanctum you may need to 55 | | customize some of the middleware Sanctum uses while processing the 56 | | request. You may change the middleware listed below as required. 57 | | 58 | */ 59 | 60 | 'middleware' => [ 61 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 62 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 63 | ], 64 | 65 | ]; 66 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Session Lifetime 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may specify the number of minutes that you wish the session 29 | | to be allowed to remain idle before it expires. If you want them 30 | | to immediately expire on the browser closing, set that option. 31 | | 32 | */ 33 | 34 | 'lifetime' => env('SESSION_LIFETIME', 120), 35 | 36 | 'expire_on_close' => false, 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Session Encryption 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This option allows you to easily specify that all of your session data 44 | | should be encrypted before it is stored. All encryption will be run 45 | | automatically by Laravel and you can use the Session like normal. 46 | | 47 | */ 48 | 49 | 'encrypt' => false, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Session File Location 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When using the native session driver, we need a location where session 57 | | files may be stored. A default has been set for you but a different 58 | | location may be specified. This is only needed for file sessions. 59 | | 60 | */ 61 | 62 | 'files' => storage_path('framework/sessions'), 63 | 64 | /* 65 | |-------------------------------------------------------------------------- 66 | | Session Database Connection 67 | |-------------------------------------------------------------------------- 68 | | 69 | | When using the "database" or "redis" session drivers, you may specify a 70 | | connection that should be used to manage these sessions. This should 71 | | correspond to a connection in your database configuration options. 72 | | 73 | */ 74 | 75 | 'connection' => env('SESSION_CONNECTION', null), 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Session Database Table 80 | |-------------------------------------------------------------------------- 81 | | 82 | | When using the "database" session driver, you may specify the table we 83 | | should use to manage the sessions. Of course, a sensible default is 84 | | provided for you; however, you are free to change this as needed. 85 | | 86 | */ 87 | 88 | 'table' => 'sessions', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Session Cache Store 93 | |-------------------------------------------------------------------------- 94 | | 95 | | While using one of the framework's cache driven session backends you may 96 | | list a cache store that should be used for these sessions. This value 97 | | must match with one of the application's configured cache "stores". 98 | | 99 | | Affects: "apc", "dynamodb", "memcached", "redis" 100 | | 101 | */ 102 | 103 | 'store' => env('SESSION_STORE', null), 104 | 105 | /* 106 | |-------------------------------------------------------------------------- 107 | | Session Sweeping Lottery 108 | |-------------------------------------------------------------------------- 109 | | 110 | | Some session drivers must manually sweep their storage location to get 111 | | rid of old sessions from storage. Here are the chances that it will 112 | | happen on a given request. By default, the odds are 2 out of 100. 113 | | 114 | */ 115 | 116 | 'lottery' => [2, 100], 117 | 118 | /* 119 | |-------------------------------------------------------------------------- 120 | | Session Cookie Name 121 | |-------------------------------------------------------------------------- 122 | | 123 | | Here you may change the name of the cookie used to identify a session 124 | | instance by ID. The name specified here will get used every time a 125 | | new session cookie is created by the framework for every driver. 126 | | 127 | */ 128 | 129 | 'cookie' => env( 130 | 'SESSION_COOKIE', 131 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 132 | ), 133 | 134 | /* 135 | |-------------------------------------------------------------------------- 136 | | Session Cookie Path 137 | |-------------------------------------------------------------------------- 138 | | 139 | | The session cookie path determines the path for which the cookie will 140 | | be regarded as available. Typically, this will be the root path of 141 | | your application but you are free to change this when necessary. 142 | | 143 | */ 144 | 145 | 'path' => '/', 146 | 147 | /* 148 | |-------------------------------------------------------------------------- 149 | | Session Cookie Domain 150 | |-------------------------------------------------------------------------- 151 | | 152 | | Here you may change the domain of the cookie used to identify a session 153 | | in your application. This will determine which domains the cookie is 154 | | available to in your application. A sensible default has been set. 155 | | 156 | */ 157 | 158 | 'domain' => env('SESSION_DOMAIN', null), 159 | 160 | /* 161 | |-------------------------------------------------------------------------- 162 | | HTTPS Only Cookies 163 | |-------------------------------------------------------------------------- 164 | | 165 | | By setting this option to true, session cookies will only be sent back 166 | | to the server if the browser has a HTTPS connection. This will keep 167 | | the cookie from being sent to you when it can't be done securely. 168 | | 169 | */ 170 | 171 | 'secure' => env('SESSION_SECURE_COOKIE'), 172 | 173 | /* 174 | |-------------------------------------------------------------------------- 175 | | HTTP Access Only 176 | |-------------------------------------------------------------------------- 177 | | 178 | | Setting this value to true will prevent JavaScript from accessing the 179 | | value of the cookie and the cookie will only be accessible through 180 | | the HTTP protocol. You are free to modify this option if needed. 181 | | 182 | */ 183 | 184 | 'http_only' => true, 185 | 186 | /* 187 | |-------------------------------------------------------------------------- 188 | | Same-Site Cookies 189 | |-------------------------------------------------------------------------- 190 | | 191 | | This option determines how your cookies behave when cross-site requests 192 | | take place, and can be used to mitigate CSRF attacks. By default, we 193 | | will set this value to "lax" since this is a secure default value. 194 | | 195 | | Supported: "lax", "strict", "none", null 196 | | 197 | */ 198 | 199 | 'same_site' => 'lax', 200 | 201 | ]; 202 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /config/vite.php: -------------------------------------------------------------------------------- 1 | [ 14 | 'default' => [ 15 | 'entrypoints' => [ 16 | 'ssr' => 'resources/js/ssr.ts', 17 | 'paths' => [ 18 | 'resources/js/app.ts', 19 | ], 20 | 'ignore' => '/\\.(d\\.ts|json)$/', 21 | ], 22 | 'dev_server' => [ 23 | 'enabled' => true, 24 | 'url' => env('DEV_SERVER_URL', 'http://localhost:5173'), 25 | 'ping_before_using_manifest' => true, 26 | 'ping_url' => null, 27 | 'ping_timeout' => 1, 28 | 'key' => env('DEV_SERVER_KEY'), 29 | 'cert' => env('DEV_SERVER_CERT'), 30 | ], 31 | 'build_path' => 'build', 32 | ], 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Aliases 38 | |-------------------------------------------------------------------------- 39 | | You can define aliases to avoid having to make relative imports. 40 | | Aliases will be written to tsconfig.json automatically so your IDE 41 | | can know how to resolve them. 42 | | https://laravel-vite.dev/configuration/laravel-package.html#aliases 43 | */ 44 | 'aliases' => [ 45 | '@' => 'resources/js', 46 | ], 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Commands 51 | |-------------------------------------------------------------------------- 52 | | Before starting the development server or building the assets, you 53 | | may need to run specific commands. With these options, you can 54 | | define what to run, automatically. 55 | | https://laravel-vite.dev/configuration/laravel-package.html#commands 56 | */ 57 | 'commands' => [ 58 | 'artisan' => [ 59 | 'vite:tsconfig', 60 | // 'typescript:generate' 61 | ], 62 | 'shell' => [ 63 | // 64 | ], 65 | ], 66 | 67 | /* 68 | |-------------------------------------------------------------------------- 69 | | Testing 70 | |-------------------------------------------------------------------------- 71 | | Depending on the way you are testing your application, 72 | | you may or may not need to use the manifest. This option controls 73 | | the manifest should be used in the "testing" environment. 74 | | https://laravel-vite.dev/configuration/laravel-package.html#testing 75 | */ 76 | 'testing' => [ 77 | 'use_manifest' => false, 78 | ], 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Environment variable prefixes 83 | |-------------------------------------------------------------------------- 84 | | This option defines the prefixes that environment variables must 85 | | have in order to be accessible from the front-end. 86 | | https://laravel-vite.dev/configuration/laravel-package.html#env_prefixes 87 | */ 88 | 'env_prefixes' => ['VITE_', 'MIX_', 'SCRIPT_'], 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Default interfaces 93 | |-------------------------------------------------------------------------- 94 | | Here you may change how some parts of the package work by replacing 95 | | their associated logic. 96 | | https://laravel-vite.dev/configuration/laravel-package.html#interfaces 97 | */ 98 | 'interfaces' => [ 99 | 'heartbeat_checker' => Innocenzi\Vite\HeartbeatCheckers\HttpHeartbeatChecker::class, 100 | 'tag_generator' => Innocenzi\Vite\TagGenerators\CallbackTagGenerator::class, 101 | 'entrypoints_finder' => Innocenzi\Vite\EntrypointsFinder\DefaultEntrypointsFinder::class, 102 | ], 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Default configuration 107 | |-------------------------------------------------------------------------- 108 | | Here you may specify which of the configurations above you wish 109 | | to use as your default one. 110 | | https://laravel-vite.dev/configuration/laravel-package.html#default 111 | */ 112 | 'default' => env('VITE_DEFAULT_CONFIG', 'default'), 113 | ]; 114 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/ContactFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->firstName, 18 | 'last_name' => $this->faker->lastName, 19 | 'email' => $this->faker->unique()->safeEmail, 20 | 'phone' => $this->faker->tollFreePhoneNumber, 21 | 'address' => $this->faker->streetAddress, 22 | 'city' => $this->faker->city, 23 | 'region' => $this->faker->state, 24 | 'country' => 'US', 25 | 'postal_code' => $this->faker->postcode, 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /database/factories/OrganizationFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->company, 18 | 'email' => $this->faker->companyEmail, 19 | 'phone' => $this->faker->tollFreePhoneNumber, 20 | 'address' => $this->faker->streetAddress, 21 | 'city' => $this->faker->city, 22 | 'region' => $this->faker->state, 23 | 'country' => 'US', 24 | 'postal_code' => $this->faker->postcode, 25 | ]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->firstName, 19 | 'last_name' => $this->faker->lastName, 20 | 'email' => $this->faker->unique()->safeEmail(), 21 | 'email_verified_at' => now(), 22 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 23 | 'remember_token' => Str::random(10), 24 | ]; 25 | } 26 | 27 | /** 28 | * Indicate that the model's email address should be unverified. 29 | * 30 | * @return \Illuminate\Database\Eloquent\Factories\Factory 31 | */ 32 | public function unverified() 33 | { 34 | return $this->state(function (array $attributes) { 35 | return [ 36 | 'email_verified_at' => null, 37 | ]; 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('personal_access_tokens'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2020_01_01_000001_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 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/2020_01_01_000002_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/2020_01_01_000003_create_accounts_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name', 50); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('accounts'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2020_01_01_000004_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('account_id')->index(); 19 | $table->string('first_name', 25); 20 | $table->string('last_name', 25); 21 | $table->string('email', 50)->unique(); 22 | $table->timestamp('email_verified_at')->nullable(); 23 | $table->string('password')->nullable(); 24 | $table->rememberToken(); 25 | $table->timestamps(); 26 | $table->softDeletes(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists('users'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /database/migrations/2020_01_01_000005_create_organizations_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('account_id')->index(); 19 | $table->string('name', 100); 20 | $table->string('email', 50)->nullable(); 21 | $table->string('phone', 50)->nullable(); 22 | $table->string('address', 150)->nullable(); 23 | $table->string('city', 50)->nullable(); 24 | $table->string('region', 50)->nullable(); 25 | $table->string('country', 2)->nullable(); 26 | $table->string('postal_code', 25)->nullable(); 27 | $table->timestamps(); 28 | $table->softDeletes(); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | * 35 | * @return void 36 | */ 37 | public function down() 38 | { 39 | Schema::dropIfExists('organizations'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /database/migrations/2020_01_01_000006_create_contacts_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('account_id')->index(); 19 | $table->integer('organization_id')->nullable()->index(); 20 | $table->string('first_name', 25); 21 | $table->string('last_name', 25); 22 | $table->string('email', 50)->nullable(); 23 | $table->string('phone', 50)->nullable(); 24 | $table->string('address', 150)->nullable(); 25 | $table->string('city', 50)->nullable(); 26 | $table->string('region', 50)->nullable(); 27 | $table->string('country', 2)->nullable(); 28 | $table->string('postal_code', 25)->nullable(); 29 | $table->timestamps(); 30 | $table->softDeletes(); 31 | }); 32 | } 33 | 34 | /** 35 | * Reverse the migrations. 36 | * 37 | * @return void 38 | */ 39 | public function down() 40 | { 41 | Schema::dropIfExists('contacts'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | 'Momentum']); 21 | 22 | User::factory()->create([ 23 | 'account_id' => $account->id, 24 | 'first_name' => 'John', 25 | 'last_name' => 'Doe', 26 | 'email' => 'johndoe@example.com', 27 | 'password' => 'secret', 28 | ]); 29 | 30 | User::factory(5)->create(['account_id' => $account->id]); 31 | 32 | $organizations = Organization::factory(100) 33 | ->create(['account_id' => $account->id]); 34 | 35 | Contact::factory(100) 36 | ->create(['account_id' => $account->id]) 37 | ->each(function ($contact) use ($organizations) { 38 | $contact->update(['organization_id' => $organizations->random()->id]); 39 | }); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vue-tsc --noEmit && vite build", 6 | "build:ssr": "vite build --ssr --config vite.config.ssr.ts", 7 | "serve": "node public/ssr/ssr.js" 8 | }, 9 | "dependencies": { 10 | "@headlessui/vue": "^1.7.7", 11 | "@heroicons/vue": "^2.0.13", 12 | "@inertiajs/server": "^0.1.0", 13 | "@inertiajs/vue3": "^1.0.0", 14 | "@popperjs/core": "^2.11.0", 15 | "@vue/server-renderer": "^3.2.37", 16 | "autoprefixer": "^10.4.0", 17 | "eslint": "^8.4.1", 18 | "eslint-plugin-vue": "^8.2.0", 19 | "lodash": "^4.17.21", 20 | "momentum-modal": "^0.2.0", 21 | "postcss": "^8.4.4", 22 | "postcss-import": "^12.0.1", 23 | "postcss-nesting": "^7.0.1", 24 | "tailwindcss": "^3.0.24", 25 | "uuid": "^8.3.2", 26 | "vue": "^3.2.27", 27 | "vue-loader": "^16.2.0", 28 | "vue-toastification": "^2.0.0-rc.5", 29 | "webpack-node-externals": "^3.0.0" 30 | }, 31 | "devDependencies": { 32 | "@babel/types": "^7.18.4", 33 | "@types/lodash": "^4.14.191", 34 | "@types/uuid": "^9.0.0", 35 | "@vitejs/plugin-vue": "^4.0.0", 36 | "prettier": "^2.8.3", 37 | "prettier-plugin-tailwindcss": "^0.2.1", 38 | "vite": "^4.0.4", 39 | "vite-plugin-laravel": "^0.2.2", 40 | "vue-tsc": "^1.0.24" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /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.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /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/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss/base"; 2 | @import 'reset'; 3 | @import "tailwindcss/components"; 4 | @import 'buttons'; 5 | @import 'form'; 6 | @import "tailwindcss/utilities"; -------------------------------------------------------------------------------- /resources/css/buttons.css: -------------------------------------------------------------------------------- 1 | .btn-indigo { 2 | @apply px-6 py-3 rounded bg-indigo-600 text-white text-sm leading-4 font-bold whitespace-nowrap hover:bg-orange-400 focus:bg-orange-400; 3 | } 4 | 5 | .btn-spinner, 6 | .btn-spinner:after { 7 | border-radius: 50%; 8 | width: 1.5em; 9 | height: 1.5em; 10 | } 11 | 12 | .btn-spinner { 13 | font-size: 10px; 14 | position: relative; 15 | text-indent: -9999em; 16 | border-top: 0.2em solid white; 17 | border-right: 0.2em solid white; 18 | border-bottom: 0.2em solid white; 19 | border-left: 0.2em solid transparent; 20 | transform: translateZ(0); 21 | animation: spinning 1s infinite linear; 22 | } 23 | 24 | @keyframes spinning { 25 | 0% { 26 | transform: rotate(0deg); 27 | } 28 | 100% { 29 | transform: rotate(360deg); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/css/form.css: -------------------------------------------------------------------------------- 1 | .form-label { 2 | @apply mb-2 block text-gray-700 select-none; 3 | } 4 | 5 | .form-input, 6 | .form-textarea, 7 | .form-select { 8 | @apply p-2 leading-normal block w-full border text-gray-700 bg-white font-sans rounded text-left appearance-none relative focus:border-indigo-400 focus:ring; 9 | 10 | &::placeholder { 11 | @apply text-gray-500 opacity-100; 12 | } 13 | } 14 | 15 | .form-select { 16 | @apply pr-6; 17 | 18 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAQCAYAAAAMJL+VAAAABGdBTUEAALGPC/xhBQAAAQtJREFUOBG1lEEOgjAQRalbGj2OG9caOACn4ALGtfEuHACiazceR1PWOH/CNA3aMiTaBDpt/7zPdBKy7M/DCL9pGkvxxVp7KsvyJftL5rZt1865M+Ucq6pyyF3hNcI7Cuu+728QYn/JQA5yKaempxuZmQngOwEaYx55nu+1lQh8GIatMGi+01NwBcEmhxBqK4nAPZJ78K0KKFAJmR3oPp8+Iwgob0Oa6+TLoeCvRx+mTUYf/FVBGTPRwDkfLxnaSrRwcH0FWhNOmrkWYbE2XEicqgSa1J0LQ+aPCuQgZiLnwewbGuz5MGoAhcIkCQcjaTBjMgtXGURMVHC1wcQEy0J+Zlj8bKAnY1/UzDe2dbAVqfXn6wAAAABJRU5ErkJggg=='); 19 | background-size: 0.7rem; 20 | background-repeat: no-repeat; 21 | background-position: right 0.7rem center; 22 | 23 | &::-ms-expand { 24 | @apply opacity-0; 25 | } 26 | } 27 | 28 | .form-input.error, 29 | .form-textarea.error, 30 | .form-select.error { 31 | @apply border-red-500 focus:ring focus:ring-red-200; 32 | } 33 | 34 | .form-error { 35 | @apply text-red-700 mt-2 text-sm; 36 | } 37 | -------------------------------------------------------------------------------- /resources/css/reset.css: -------------------------------------------------------------------------------- 1 | input, select, textarea, button, div, a { 2 | &:focus, &:active { 3 | outline: none; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/Login.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 53 | -------------------------------------------------------------------------------- /resources/js/Pages/Contacts/Create.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 64 | -------------------------------------------------------------------------------- /resources/js/Pages/Contacts/Edit.vue: -------------------------------------------------------------------------------- 1 | 49 | 50 | 98 | -------------------------------------------------------------------------------- /resources/js/Pages/Contacts/Index.vue: -------------------------------------------------------------------------------- 1 | 94 | 95 | 141 | -------------------------------------------------------------------------------- /resources/js/Pages/Dashboard/Index.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 19 | -------------------------------------------------------------------------------- /resources/js/Pages/Organizations/Create.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 53 | -------------------------------------------------------------------------------- /resources/js/Pages/Organizations/Edit.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 78 | -------------------------------------------------------------------------------- /resources/js/Pages/Organizations/Index.vue: -------------------------------------------------------------------------------- 1 | 79 | 80 | 126 | -------------------------------------------------------------------------------- /resources/js/Pages/Profile/Show.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 49 | -------------------------------------------------------------------------------- /resources/js/Plugins/notifications.ts: -------------------------------------------------------------------------------- 1 | import { App, Plugin } from "vue" 2 | import { usePage, router } from "@inertiajs/vue3" 3 | import { useToast } from "vue-toastification" 4 | 5 | const { success, error } = useToast() 6 | 7 | export const notifications: Plugin = { 8 | install(app: App) { 9 | router.on("finish", (event) => { 10 | const { props } = usePage() 11 | 12 | if (props.flash?.success) { 13 | success(props.flash?.success) 14 | } 15 | 16 | if (props.flash?.error) { 17 | error(props.flash?.error) 18 | } 19 | }) 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /resources/js/Shared/Banner.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 45 | -------------------------------------------------------------------------------- /resources/js/Shared/Dropdown.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 66 | -------------------------------------------------------------------------------- /resources/js/Shared/FileInput.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 66 | -------------------------------------------------------------------------------- /resources/js/Shared/Icon.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 36 | -------------------------------------------------------------------------------- /resources/js/Shared/Layout.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 82 | -------------------------------------------------------------------------------- /resources/js/Shared/LoadingButton.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 15 | -------------------------------------------------------------------------------- /resources/js/Shared/Logo.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /resources/js/Shared/MainMenu.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 62 | -------------------------------------------------------------------------------- /resources/js/Shared/Modal.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 46 | -------------------------------------------------------------------------------- /resources/js/Shared/Pagination.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 27 | -------------------------------------------------------------------------------- /resources/js/Shared/SearchFilter.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 58 | -------------------------------------------------------------------------------- /resources/js/Shared/SelectInput.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 54 | -------------------------------------------------------------------------------- /resources/js/Shared/Slideover.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 51 | -------------------------------------------------------------------------------- /resources/js/Shared/TextInput.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 51 | -------------------------------------------------------------------------------- /resources/js/Shared/TextareaInput.vue: -------------------------------------------------------------------------------- 1 |