├── .DS_Store ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── app ├── Enums │ ├── ModelStatus.php │ └── PersonTitle.php ├── Helpers │ └── PermissionsHelper.php ├── Http │ ├── Controllers │ │ ├── Admin │ │ │ ├── ActivityController.php │ │ │ ├── CategoryController.php │ │ │ ├── ClientController.php │ │ │ ├── CommentController.php │ │ │ ├── DashboardController.php │ │ │ ├── MenuController.php │ │ │ ├── NoteController.php │ │ │ ├── PageController.php │ │ │ ├── PostCategoryController.php │ │ │ ├── PostController.php │ │ │ ├── Role │ │ │ │ └── RoleController.php │ │ │ ├── SettingController.php │ │ │ ├── TagController.php │ │ │ └── Users │ │ │ │ └── UserController.php │ │ ├── Auth │ │ │ ├── AuthenticatedSessionController.php │ │ │ ├── ConfirmablePasswordController.php │ │ │ ├── EmailVerificationNotificationController.php │ │ │ ├── EmailVerificationPromptController.php │ │ │ ├── NewPasswordController.php │ │ │ ├── PasswordController.php │ │ │ ├── PasswordResetLinkController.php │ │ │ ├── RegisteredUserController.php │ │ │ └── VerifyEmailController.php │ │ ├── Controller.php │ │ ├── DashboardController.php │ │ ├── HomepageController.php │ │ ├── PageController.php │ │ ├── PostController.php │ │ └── ProfileController.php │ ├── Middleware │ │ └── HandleInertiaRequests.php │ ├── Requests │ │ ├── Auth │ │ │ └── LoginRequest.php │ │ └── ProfileUpdateRequest.php │ ├── Resources │ │ ├── ActivityLogResource.php │ │ ├── CategoryResource.php │ │ ├── ClientResource.php │ │ ├── MenuResource.php │ │ ├── NoteResource.php │ │ ├── PageResource.php │ │ ├── PostCategoryResource.php │ │ ├── PostResource.php │ │ ├── RoleResource.php │ │ ├── TagResource.php │ │ └── UserResource.php │ └── Traits │ │ └── DeleteableActions.php ├── Models │ ├── Attachment.php │ ├── Category.php │ ├── City.php │ ├── Client.php │ ├── Comment.php │ ├── Country.php │ ├── Menu.php │ ├── Note.php │ ├── Page.php │ ├── Post.php │ ├── PostCategory.php │ ├── Setting.php │ ├── SettingGroup.php │ ├── State.php │ ├── Status.php │ ├── Tag.php │ ├── Taggable.php │ └── User.php ├── Providers │ └── AppServiceProvider.php ├── Repositories │ ├── BaseRepository.php │ ├── CountryRepository.php │ ├── MenuRepository.php │ ├── PostCategoryRepository.php │ ├── PostRepository.php │ └── TagRepository.php └── Traits │ ├── ActivityLoggable.php │ ├── HasSlug.php │ ├── HasStatuses.php │ └── TaggableTrait.php ├── artisan ├── bootstrap ├── app.php ├── cache │ └── .gitignore └── providers.php ├── components.json ├── composer.json ├── composer.lock ├── config ├── activitylog.php ├── app.php ├── auth.php ├── cache.php ├── database.php ├── filesystems.php ├── logging.php ├── mail.php ├── permission.php ├── query-builder.php ├── queue.php ├── services.php └── session.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 0001_01_01_000000_create_users_table.php │ ├── 0001_01_01_000001_create_cache_table.php │ ├── 0001_01_01_000002_create_jobs_table.php │ ├── 2024_04_15_114830_create_categories_table.php │ ├── 2024_04_16_094020_create_roles_table.php │ ├── 2024_04_16_094424_add_role_id_column_in_users_table.php │ ├── 2024_04_19_044457_create_activity_log_table.php │ ├── 2024_04_19_044458_add_event_column_to_activity_log_table.php │ ├── 2024_04_19_044459_add_batch_uuid_column_to_activity_log_table.php │ ├── 2024_04_21_164513_create_notes_table.php │ ├── 2024_04_22_161338_create_attachments_table.php │ ├── 2024_04_23_125031_create_clients_table.php │ ├── 2024_04_24_053806_drop_roles_table.php │ ├── 2024_04_24_055647_create_permission_tables.php │ ├── 2024_04_25_095056_create_comments_table.php │ ├── 2024_04_25_163359_create_statuses_table.php │ ├── 2024_04_26_174546_add_group_column_in_permissions_table.php │ ├── 2024_04_29_184717_add_user_id_column_in_notes_table.php │ ├── 2024_05_09_100901_create_countries_table.php │ ├── 2024_05_09_100906_create_states_table.php │ ├── 2024_05_09_100910_create_cities_table.php │ ├── 2024_07_15_075617_create_pages_table.php │ ├── 2024_07_15_075657_create_posts_table.php │ ├── 2024_08_12_201453_add_puck_body_column_in_pages_table.php │ ├── 2024_08_26_163152_add_indexes_in_pages_table.php │ ├── 2024_08_26_163726_add_indexes_in_posts_table.php │ ├── 2024_08_27_163240_create_menus_table.php │ ├── 2024_09_11_201454_create_setting_groups_table.php │ ├── 2024_09_11_201455_create_settings_table.php │ ├── 2024_09_18_132142_add_short_description_column_in_posts_table.php │ ├── 2024_09_18_133308_create_post_categories_table.php │ ├── 2024_09_18_134102_create_post_post_category_table.php │ ├── 2024_09_18_134104_add_relation_type_column_in_attachments_table.php │ ├── 2024_10_13_100430_create_tags_table.php │ └── 2024_10_13_100910_create_taggables_table.php └── seeders │ ├── CitySeeder.php │ ├── CountrySeeder.php │ ├── DatabaseSeeder.php │ ├── PageSeeder.php │ ├── PermissionSeeder.php │ ├── RoleSeeder.php │ ├── SettingSeeder.php │ ├── StateSeeder.php │ ├── UserSeeder.php │ └── cities.php ├── jsconfig.json ├── package-lock.json ├── package.json ├── phpunit.xml ├── postcss.config.js ├── public ├── .DS_Store ├── .htaccess ├── fav │ ├── .DS_Store │ ├── android-icon-144x144.png │ ├── android-icon-192x192.png │ ├── android-icon-36x36.png │ ├── android-icon-48x48.png │ ├── android-icon-72x72.png │ ├── android-icon-96x96.png │ ├── apple-icon-114x114.png │ ├── apple-icon-120x120.png │ ├── apple-icon-144x144.png │ ├── apple-icon-152x152.png │ ├── apple-icon-180x180.png │ ├── apple-icon-57x57.png │ ├── apple-icon-60x60.png │ ├── apple-icon-72x72.png │ ├── apple-icon-76x76.png │ ├── apple-icon-precomposed.png │ ├── apple-icon.png │ ├── browserconfig.xml │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon-96x96.png │ ├── favicon.ico │ ├── jytech-logo-light.svg │ ├── logo-icon-1.svg │ ├── logo-icon.svg │ ├── manifest.json │ ├── ms-icon-144x144.png │ ├── ms-icon-150x150.png │ ├── ms-icon-310x310.png │ └── ms-icon-70x70.png ├── images │ ├── .DS_Store │ ├── errors │ │ └── undraw_cancel_re_pkdm.svg │ ├── lis-dark.png │ ├── lis-white.png │ └── lis.svg ├── index.php └── robots.txt ├── resources ├── css │ ├── app.css │ └── shadcn.css ├── js │ ├── Components │ │ ├── Activities │ │ │ └── ActivityLogs.jsx │ │ ├── Admin │ │ │ ├── AdminGlobalHeader.jsx │ │ │ ├── MainSiteIconLink.jsx │ │ │ └── dashboard-nav.jsx │ │ ├── ApplicationLogo.jsx │ │ ├── Attachments │ │ │ ├── AttachmentGrid.jsx │ │ │ ├── AttachmentThumbnail.jsx │ │ │ └── UploadAttachmentsForm.jsx │ │ ├── Can.jsx │ │ ├── Charts │ │ │ ├── DebitCreditBarChartSmall.jsx │ │ │ └── Index.jsx │ │ ├── Checkbox.jsx │ │ ├── Clients │ │ │ └── ClientForm.jsx │ │ ├── Comments │ │ │ ├── CommentForm.jsx │ │ │ └── CommentList.jsx │ │ ├── DangerButton.jsx │ │ ├── DateRangePicker.jsx │ │ ├── Dropdown.jsx │ │ ├── EditorInput.jsx │ │ ├── HTMLCodeEditorInput.jsx │ │ ├── InputError.jsx │ │ ├── InputLabel.jsx │ │ ├── LoadingButton.jsx │ │ ├── Menus │ │ │ └── Tree │ │ │ │ ├── SortableTree.jsx │ │ │ │ ├── components │ │ │ │ ├── Action │ │ │ │ │ ├── Action.jsx │ │ │ │ │ ├── Action.module.css │ │ │ │ │ └── index.jsx │ │ │ │ ├── Handle │ │ │ │ │ ├── Handle.jsx │ │ │ │ │ └── index.jsx │ │ │ │ ├── Remove │ │ │ │ │ ├── Remove.jsx │ │ │ │ │ └── index.jsx │ │ │ │ ├── TreeItem │ │ │ │ │ ├── SortableTreeItem.jsx │ │ │ │ │ ├── TreeItem.jsx │ │ │ │ │ ├── TreeItem.module.css │ │ │ │ │ └── index.jsx │ │ │ │ └── index.jsx │ │ │ │ ├── keyboardCoordinates.jsx │ │ │ │ └── utilities.jsx │ │ ├── MetaInputsCard.jsx │ │ ├── Modal.jsx │ │ ├── NavLink.jsx │ │ ├── PageHeader.jsx │ │ ├── PageHeading.jsx │ │ ├── Pages │ │ │ ├── PageForm.jsx │ │ │ └── PuckPageForm.jsx │ │ ├── PostCategories │ │ │ └── PostCategoryForm.jsx │ │ ├── Posts │ │ │ ├── DeletePermanentalyPostDialog.jsx │ │ │ ├── DeletePostDialog.jsx │ │ │ ├── PostForm.jsx │ │ │ └── RestorePostDialog.jsx │ │ ├── PrimaryButton.jsx │ │ ├── Puck │ │ │ ├── Blocks │ │ │ │ ├── ButtonComponent │ │ │ │ │ ├── Button.css │ │ │ │ │ └── index.jsx │ │ │ │ ├── ButtonGroup │ │ │ │ │ └── index.jsx │ │ │ │ ├── Card │ │ │ │ │ ├── Card.css │ │ │ │ │ └── index.jsx │ │ │ │ ├── Columns │ │ │ │ │ ├── Columns.css │ │ │ │ │ └── index.jsx │ │ │ │ ├── CommonBlockProps.jsx │ │ │ │ ├── Flex │ │ │ │ │ ├── Flex.css │ │ │ │ │ └── index.jsx │ │ │ │ ├── HTMLCodeEditor.jsx │ │ │ │ ├── Heading.jsx │ │ │ │ ├── Image.jsx │ │ │ │ ├── Paragraph.jsx │ │ │ │ ├── VerticalSpace.jsx │ │ │ │ ├── WYSIWYG.jsx │ │ │ │ └── WYSIWYG2.jsx │ │ │ ├── Components │ │ │ │ ├── Columns.jsx │ │ │ │ └── Section │ │ │ │ │ ├── Section.css │ │ │ │ │ └── index.jsx │ │ │ ├── PuckEditor.jsx │ │ │ ├── PuckPageEditor.jsx │ │ │ └── config.jsx │ │ ├── RTable.jsx │ │ ├── ResponsiveNavLink.jsx │ │ ├── Screenshot.jsx │ │ ├── SecondaryButton.jsx │ │ ├── Settings │ │ │ └── SettingField.jsx │ │ ├── ShadcnCard.jsx │ │ ├── SlugInput.jsx │ │ ├── SmallEditorInput.jsx │ │ ├── Statuses │ │ │ ├── StatusDetailsPopover.jsx │ │ │ └── StatusUpdateForm.jsx │ │ ├── TextInput.jsx │ │ ├── ThemeToggle │ │ │ ├── theme-provider.jsx │ │ │ └── theme-toggle.jsx │ │ ├── TipTap │ │ │ ├── TipTap.css │ │ │ └── TipTapEditor.jsx │ │ ├── UserHoverCard.jsx │ │ ├── UserInfoCard.jsx │ │ └── icons.jsx │ ├── Helpers │ │ └── GlobalFunctions.jsx │ ├── Layouts │ │ ├── Footer.jsx │ │ ├── GuestLayout.jsx │ │ ├── Header.jsx │ │ ├── MobileNavbar.jsx │ │ ├── Navbar.jsx │ │ ├── PageLayout.jsx │ │ ├── SiteFooter.jsx │ │ ├── SiteParentLayout.jsx │ │ ├── admin │ │ │ ├── AuthenticatedLayout.jsx │ │ │ ├── HalfLayout.jsx │ │ │ ├── Header.jsx │ │ │ ├── TwoColumnLayout.jsx │ │ │ ├── mobile-sidebar.jsx │ │ │ ├── sidebar.jsx │ │ │ └── user-nav.jsx │ │ ├── blank-layout.jsx │ │ └── shadcn-provider.jsx │ ├── Pages │ │ ├── Admin │ │ │ ├── ActivityLogs │ │ │ │ └── ActivityLogs.jsx │ │ │ ├── Categories │ │ │ │ ├── Categories.jsx │ │ │ │ └── Category.jsx │ │ │ ├── Clients │ │ │ │ ├── Client.jsx │ │ │ │ └── Clients.jsx │ │ │ ├── Dashboard.jsx │ │ │ ├── Menus │ │ │ │ ├── Menu.jsx │ │ │ │ └── Menus.jsx │ │ │ ├── Notes │ │ │ │ ├── Note.jsx │ │ │ │ └── Notes.jsx │ │ │ ├── Pages │ │ │ │ ├── Page.jsx │ │ │ │ ├── Pages.jsx │ │ │ │ └── PuckPage.jsx │ │ │ ├── PostCategories │ │ │ │ ├── PostCategories.jsx │ │ │ │ └── PostCategory.jsx │ │ │ ├── Posts │ │ │ │ ├── PostPage.jsx │ │ │ │ └── Posts.jsx │ │ │ ├── Roles │ │ │ │ ├── Role.jsx │ │ │ │ └── Roles.jsx │ │ │ ├── Settings │ │ │ │ └── View.jsx │ │ │ ├── Tags │ │ │ │ └── Tags.jsx │ │ │ └── Users │ │ │ │ ├── User.jsx │ │ │ │ └── Users.jsx │ │ ├── Auth │ │ │ ├── ConfirmPassword.jsx │ │ │ ├── ForgotPassword.jsx │ │ │ ├── Login.jsx │ │ │ ├── Register.jsx │ │ │ ├── ResetPassword.jsx │ │ │ └── VerifyEmail.jsx │ │ ├── Blog │ │ │ ├── Blog.jsx │ │ │ └── Post.jsx │ │ ├── Homepage.jsx │ │ ├── Page.jsx │ │ ├── Profile │ │ │ ├── Edit.jsx │ │ │ └── Partials │ │ │ │ ├── DeleteUserForm.jsx │ │ │ │ ├── UpdatePasswordForm.jsx │ │ │ │ └── UpdateProfileInformationForm.jsx │ │ └── Welcome.jsx │ ├── app.jsx │ ├── bootstrap.js │ ├── data │ │ ├── admin │ │ │ └── nav-data.js │ │ └── colors.js │ ├── shadcn.js │ └── shadcn │ │ ├── ui │ │ ├── .DS_Store │ │ ├── MultiSelector.jsx │ │ ├── accordion.jsx │ │ ├── alert-dialog.jsx │ │ ├── alert.jsx │ │ ├── avatar.jsx │ │ ├── badge.jsx │ │ ├── button.jsx │ │ ├── calendar.jsx │ │ ├── card.jsx │ │ ├── checkbox.jsx │ │ ├── combobox.jsx │ │ ├── command.jsx │ │ ├── dialog.jsx │ │ ├── dropdown-menu.jsx │ │ ├── form.jsx │ │ ├── hover-card.jsx │ │ ├── input.jsx │ │ ├── label.jsx │ │ ├── navigation-menu.jsx │ │ ├── popover.jsx │ │ ├── radio-group.jsx │ │ ├── resizable.jsx │ │ ├── scroll-area.jsx │ │ ├── select.jsx │ │ ├── separator.jsx │ │ ├── sheet.jsx │ │ ├── skeleton.jsx │ │ ├── slider.jsx │ │ ├── sonner.jsx │ │ ├── switch.jsx │ │ ├── table.jsx │ │ ├── tabs.jsx │ │ ├── text-muted.jsx │ │ ├── textarea.jsx │ │ ├── toast.jsx │ │ ├── toaster.jsx │ │ ├── toggle-group.jsx │ │ ├── toggle.jsx │ │ ├── tooltip.jsx │ │ └── use-toast.js │ │ └── utils.js └── views │ ├── app.blade.php │ ├── errors │ ├── 401.blade.php │ ├── 402.blade.php │ ├── 403.blade.php │ ├── 404.blade.php │ ├── 419.blade.php │ ├── 429.blade.php │ ├── 500.blade.php │ ├── 503.blade.php │ ├── layout.blade.php │ └── minimal.blade.php │ └── welcome.blade.php ├── routes ├── admin.php ├── auth.php ├── console.php └── web.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 ├── Feature │ ├── Auth │ │ ├── AuthenticationTest.php │ │ ├── EmailVerificationTest.php │ │ ├── PasswordConfirmationTest.php │ │ ├── PasswordResetTest.php │ │ ├── PasswordUpdateTest.php │ │ └── RegistrationTest.php │ ├── ExampleTest.php │ └── ProfileTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── todo.md └── vite.config.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/.DS_Store -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_TIMEZONE=UTC 6 | APP_URL=http://localhost 7 | 8 | APP_LOCALE=en 9 | APP_FALLBACK_LOCALE=en 10 | APP_FAKER_LOCALE=en_US 11 | 12 | APP_MAINTENANCE_DRIVER=file 13 | APP_MAINTENANCE_STORE=database 14 | 15 | BCRYPT_ROUNDS=12 16 | 17 | LOG_CHANNEL=stack 18 | LOG_STACK=single 19 | LOG_DEPRECATIONS_CHANNEL=null 20 | LOG_LEVEL=debug 21 | 22 | DB_CONNECTION=mysql 23 | DB_HOST=127.0.0.1 24 | DB_PORT=3306 25 | DB_DATABASE=laravel 26 | DB_USERNAME=root 27 | DB_PASSWORD= 28 | 29 | SESSION_DRIVER=database 30 | SESSION_LIFETIME=120 31 | SESSION_ENCRYPT=false 32 | SESSION_PATH=/ 33 | SESSION_DOMAIN=null 34 | 35 | BROADCAST_CONNECTION=log 36 | FILESYSTEM_DISK=local 37 | QUEUE_CONNECTION=database 38 | 39 | CACHE_STORE=database 40 | CACHE_PREFIX= 41 | 42 | MEMCACHED_HOST=127.0.0.1 43 | 44 | REDIS_CLIENT=phpredis 45 | REDIS_HOST=127.0.0.1 46 | REDIS_PASSWORD=null 47 | REDIS_PORT=6379 48 | 49 | MAIL_MAILER=log 50 | MAIL_HOST=127.0.0.1 51 | MAIL_PORT=2525 52 | MAIL_USERNAME=null 53 | MAIL_PASSWORD=null 54 | MAIL_ENCRYPTION=null 55 | MAIL_FROM_ADDRESS="hello@example.com" 56 | MAIL_FROM_NAME="${APP_NAME}" 57 | 58 | AWS_ACCESS_KEY_ID= 59 | AWS_SECRET_ACCESS_KEY= 60 | AWS_DEFAULT_REGION=us-east-1 61 | AWS_BUCKET= 62 | AWS_USE_PATH_STYLE_ENDPOINT=false 63 | 64 | VITE_APP_NAME="${APP_NAME}" 65 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.phpunit.cache 2 | /node_modules 3 | /public/build 4 | /public/hot 5 | /public/storage 6 | /storage/*.key 7 | /vendor 8 | .env 9 | .env.backup 10 | .env.production 11 | .phpunit.result.cache 12 | Homestead.json 13 | Homestead.yaml 14 | auth.json 15 | npm-debug.log 16 | yarn-error.log 17 | /.fleet 18 | /.idea 19 | /.vscode 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Gautam Kumar 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 | -------------------------------------------------------------------------------- /app/Enums/ModelStatus.php: -------------------------------------------------------------------------------- 1 | latest()->paginate($request->get('limit', config('app.pagination_limit')))->withQueryString(); 16 | return Inertia::render('Admin/ActivityLogs/ActivityLogs', ['activityLogs' => ActivityLogResource::collection($activityLogs)]); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/CommentController.php: -------------------------------------------------------------------------------- 1 | validate([ 17 | 'body' => 'required|string', 18 | 'model_type' => 'required|string|in:clients', 19 | 'model_id' => 'required|integer', 20 | ]); 21 | 22 | $user = auth()->user(); 23 | $model = null; 24 | 25 | if($request->model_type == 'clients') { 26 | $model = Client::findOrFail($request->model_id); 27 | } 28 | 29 | if(!$model) { 30 | return redirect()->back()->with(['flash_type' => 'error', 'flash_message' => 'Invalid data while creating comment.']); 31 | } 32 | 33 | $model->comments()->create(['body' => $request->body, 'user_id' => auth()->id() ]); 34 | 35 | if ($request->model_type == 'clients') { 36 | activity() 37 | ->causedBy($user) 38 | ->performedOn($model) 39 | ->event('attachment_uploaded') 40 | ->log('Comment added - Clients - ' . $model->title . ' (#' . $model->id . '). By User : ' . $user->full_name . ' (#' . $user->id . ')'); 41 | } 42 | 43 | return redirect()->back()->with(['flash_type' => 'success', 'flash_message' => 'Comment added successfully']); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/DashboardController.php: -------------------------------------------------------------------------------- 1 | user(); 17 | $totalPostsCount = Post::count(); 18 | $publishedPostCount = Post::published()->count(); 19 | $totalPagesCount = Page::count(); 20 | $publishedPageCount = Page::published()->count(); 21 | 22 | return Inertia::render('Admin/Dashboard', [ 23 | 'stats' => [ 24 | 'totalPostsCount' => $totalPostsCount, 25 | 'publishedPostCount' => $publishedPostCount, 26 | 'totalPagesCount' => $totalPagesCount, 27 | 'publishedPageCount' => $publishedPageCount 28 | ] 29 | ]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/TagController.php: -------------------------------------------------------------------------------- 1 | paginate($request->get('limit', config('app.pagination_limit')))->withQueryString(); 17 | return Inertia::render('Admin/Tags/Tags', ['tags' => TagResource::collection($tags)]); 18 | } 19 | 20 | public function store(Request $request) 21 | { 22 | $request->validate([ 23 | 'name' => 'required|string', 24 | ]); 25 | 26 | $tag = Tag::create($request->all()); 27 | 28 | return redirect()->route('admin.tags.index', $tag->id)->with(['flash_type' => 'success', 'flash_message' => 'Tag created successfully', 'flash_description' => $tag->name]); 29 | } 30 | 31 | public function update(Request $request, $id) 32 | { 33 | $request->validate([ 34 | 'name' => 'required|string', 35 | ]); 36 | 37 | $tag = Tag::findOrFail($id); 38 | $tag->fill($request->all()); 39 | $tag->save(); 40 | 41 | return redirect()->route('admin.tags.index', $tag->id)->with(['flash_type' => 'success', 'flash_message' => 'Tag updated successfully', 'flash_description' => $tag->name]); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ConfirmablePasswordController.php: -------------------------------------------------------------------------------- 1 | validate([ 29 | 'email' => $request->user()->email, 30 | 'password' => $request->password, 31 | ])) { 32 | throw ValidationException::withMessages([ 33 | 'password' => __('auth.password'), 34 | ]); 35 | } 36 | 37 | $request->session()->put('auth.password_confirmed_at', time()); 38 | 39 | return redirect()->intended(route('dashboard', absolute: false)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/EmailVerificationNotificationController.php: -------------------------------------------------------------------------------- 1 | user()->hasVerifiedEmail()) { 17 | return redirect()->intended(route('dashboard', absolute: false)); 18 | } 19 | 20 | $request->user()->sendEmailVerificationNotification(); 21 | 22 | return back()->with('status', 'verification-link-sent'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/EmailVerificationPromptController.php: -------------------------------------------------------------------------------- 1 | user()->hasVerifiedEmail() 19 | ? redirect()->intended(route('dashboard', absolute: false)) 20 | : Inertia::render('Auth/VerifyEmail', ['status' => session('status')]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordController.php: -------------------------------------------------------------------------------- 1 | validate([ 19 | 'current_password' => ['required', 'current_password'], 20 | 'password' => ['required', Password::defaults(), 'confirmed'], 21 | ]); 22 | 23 | $request->user()->update([ 24 | 'password' => Hash::make($validated['password']), 25 | ]); 26 | 27 | return back(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordResetLinkController.php: -------------------------------------------------------------------------------- 1 | session('status'), 22 | ]); 23 | } 24 | 25 | /** 26 | * Handle an incoming password reset link request. 27 | * 28 | * @throws \Illuminate\Validation\ValidationException 29 | */ 30 | public function store(Request $request): RedirectResponse 31 | { 32 | $request->validate([ 33 | 'email' => 'required|email', 34 | ]); 35 | 36 | // We will send the password reset link to this user. Once we have attempted 37 | // to send the link, we will examine the response then see the message we 38 | // need to show to the user. Finally, we'll send out a proper response. 39 | $status = Password::sendResetLink( 40 | $request->only('email') 41 | ); 42 | 43 | if ($status == Password::RESET_LINK_SENT) { 44 | return back()->with('status', __($status)); 45 | } 46 | 47 | throw ValidationException::withMessages([ 48 | 'email' => [trans($status)], 49 | ]); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisteredUserController.php: -------------------------------------------------------------------------------- 1 | validate([ 34 | 'name' => 'required|string|max:255', 35 | 'email' => 'required|string|lowercase|email|max:255|unique:'.User::class, 36 | 'password' => ['required', 'confirmed', Rules\Password::defaults()], 37 | ]); 38 | 39 | $user = User::create([ 40 | 'name' => $request->name, 41 | 'email' => $request->email, 42 | 'password' => Hash::make($request->password), 43 | ]); 44 | 45 | $user->assignRole('user'); 46 | 47 | event(new Registered($user)); 48 | 49 | Auth::login($user); 50 | 51 | return redirect(route('dashboard', absolute: false)); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/VerifyEmailController.php: -------------------------------------------------------------------------------- 1 | user()->hasVerifiedEmail()) { 18 | return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); 19 | } 20 | 21 | if ($request->user()->markEmailAsVerified()) { 22 | event(new Verified($request->user())); 23 | } 24 | 25 | return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | user(); 15 | if($user->hasRole('admin')) { 16 | return redirect()->intended(route('admin.dashboard')); 17 | } 18 | return Inertia::render('Welcome', []); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomepageController.php: -------------------------------------------------------------------------------- 1 | first(); 15 | 16 | //$post->tags()->sync([1]); 17 | 18 | $page = Page::slug('home')->firstOrNew(); 19 | 20 | activity()->withoutLogs(function () use ($page) { 21 | $page->increment('views'); 22 | }); 23 | 24 | return Inertia::render('Homepage', ['page' => $page]); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Controllers/PageController.php: -------------------------------------------------------------------------------- 1 | published()->firstOrFail(); 15 | $page->increment('views'); 16 | 17 | return Inertia::render('Page', ['page' => $page]); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Controllers/PostController.php: -------------------------------------------------------------------------------- 1 | latest()->published(); 15 | if($request->has('category')) { 16 | $posts->whereHas('categories', function($query) use ($request) { 17 | $query->where('slug', $request->get('category')); 18 | }); 19 | } 20 | $posts = $posts->paginate($request->get('limit', config('app.pagination_limit')))->withQueryString(); 21 | 22 | return Inertia::render('Blog/Blog', ['posts' => PostResource::collection($posts)]); 23 | } 24 | 25 | public function show($slug) 26 | { 27 | $post = Post::with('image', 'categories')->where('slug', $slug)->published()->firstOrFail(); 28 | 29 | return Inertia::render('Blog/Post', ['post' => new PostResource($post)]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Requests/ProfileUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | public function rules(): array 17 | { 18 | return [ 19 | 'name' => ['required', 'string', 'max:255'], 20 | 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)], 21 | ]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Http/Resources/ActivityLogResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | $data['created_at_string'] = $this->created_at->toDateTimeString(); 19 | $data['updated_at_string'] = $this->updated_at->toDateTimeString(); 20 | return $data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Resources/CategoryResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | $data['created_at_string'] = $this->created_at->toDateTimeString(); 19 | $data['updated_at_string'] = $this->updated_at->toDateTimeString(); 20 | return $data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Resources/ClientResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | $data['created_at_string'] = $this->created_at->toDateTimeString(); 19 | $data['updated_at_string'] = $this->updated_at->toDateTimeString(); 20 | return $data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Resources/MenuResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | $data['created_at_string'] = $this->created_at->toDateTimeString(); 19 | $data['updated_at_string'] = $this->updated_at->toDateTimeString(); 20 | return $data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Resources/NoteResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | $data['created_at_string'] = $this->created_at->toDateTimeString(); 19 | $data['updated_at_string'] = $this->updated_at->toDateTimeString(); 20 | return $data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Resources/PageResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | $data['created_at_string'] = $this->created_at->toDateTimeString(); 19 | $data['updated_at_string'] = $this->updated_at->toDateTimeString(); 20 | return $data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Resources/PostCategoryResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | $data['created_at_string'] = $this->created_at->toDateTimeString(); 19 | $data['updated_at_string'] = $this->updated_at->toDateTimeString(); 20 | return $data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Resources/PostResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | $data['created_at_string'] = $this->created_at->toDateTimeString(); 19 | $data['updated_at_string'] = $this->updated_at->toDateTimeString(); 20 | $this->whenLoaded('categories') && $data['categories'] = CategoryResource::collection($this->categories); 21 | return $data; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Http/Resources/RoleResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | return parent::toArray($request); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Resources/TagResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | return $data; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Resources/UserResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | $data = parent::toArray($request); 18 | $data['created_at_string'] = $this->created_at->toDateTimeString(); 19 | $data['updated_at_string'] = $this->updated_at->toDateTimeString(); 20 | return $data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Models/Attachment.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 21 | } 22 | 23 | function attachmentable(): MorphTo 24 | { 25 | return $this->morphTo(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Models/Category.php: -------------------------------------------------------------------------------- 1 | belongsTo(Category::class, 'parent_id'); 20 | } 21 | 22 | function children() : HasMany { 23 | return $this->hasMany(Category::class, 'parent_id'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Models/City.php: -------------------------------------------------------------------------------- 1 | first_name . ' ' . $this->last_name)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Models/Comment.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 19 | } 20 | 21 | function commentable() : MorphTo { 22 | return $this->morphTo(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Models/Country.php: -------------------------------------------------------------------------------- 1 | 'array', 24 | ]; 25 | 26 | protected static function booted(): void 27 | { 28 | // static::updated(function (Model $model) { 29 | // Cache::forget("menus.{$model->slug}"); 30 | // }); 31 | } 32 | 33 | public function setSlugAttribute($value) 34 | { 35 | $this->attributes['slug'] = str()->of(strtolower($value))->slug('-'); 36 | } 37 | 38 | public function user() 39 | { 40 | return $this->belongsTo(User::class); 41 | } 42 | 43 | public static function getMenu($slug) 44 | { 45 | return Cache::rememberForever("menus.{$slug}", function () use ($slug) { 46 | return self::where('slug', $slug)->first(); 47 | }); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/Models/Note.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Models/Page.php: -------------------------------------------------------------------------------- 1 | 'json' 20 | ]; 21 | } 22 | 23 | public function user() 24 | { 25 | return $this->belongsTo(User::class); 26 | } 27 | 28 | function scopePublished($posts) 29 | { 30 | return $posts->where('status', 1); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Models/Post.php: -------------------------------------------------------------------------------- 1 | 'datetime:Y-m-d H:i:s', 23 | ]; 24 | } 25 | 26 | public function user() 27 | { 28 | return $this->belongsTo(User::class); 29 | } 30 | 31 | public function categories() 32 | { 33 | return $this->belongsToMany(PostCategory::class, 'post_post_category', 'post_id', 'post_category_id'); 34 | } 35 | 36 | function scopePublished($posts) 37 | { 38 | return $posts->where('status', 1); 39 | } 40 | 41 | function image(): MorphOne 42 | { 43 | return $this->morphOne(Attachment::class, 'attachmentable')->where('relation_type', 'image')->latestOfMany(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Models/PostCategory.php: -------------------------------------------------------------------------------- 1 | belongsToMany(Post::class, 'post_post_category', 'post_category_id', 'post_id')->latest(); 20 | } 21 | 22 | public function user() 23 | { 24 | return $this->belongsTo(User::class); 25 | } 26 | 27 | function image(): MorphOne 28 | { 29 | return $this->morphOne(Attachment::class, 'attachmentable')->where('relation_type', 'image')->latestOfMany(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Models/Setting.php: -------------------------------------------------------------------------------- 1 | where('key', $groupKey)->first(); 30 | $settings = $settingGroup->children->pluck('settings')->flatten(); 31 | $values = []; 32 | foreach ($settings as $setting) { 33 | $values[$setting->key] = $setting->value; 34 | } 35 | return $values; 36 | }); 37 | 38 | } 39 | 40 | public function settingGroup() 41 | { 42 | return $this->belongsTo(SettingGroup::class); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Models/SettingGroup.php: -------------------------------------------------------------------------------- 1 | belongsTo(SettingGroup::class, 'parent_id'); 26 | } 27 | 28 | public function children() 29 | { 30 | return $this->hasMany(SettingGroup::class, 'parent_id')->orderBy('order', 'ASC')->orderBy('name', 'ASC'); 31 | } 32 | 33 | public function settings() 34 | { 35 | return $this->hasMany(Setting::class)->orderBy('order', 'ASC')->orderBy('name', 'ASC'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Models/State.php: -------------------------------------------------------------------------------- 1 | ModelStatus::class, 23 | ]; 24 | } 25 | 26 | function user() : BelongsTo { 27 | return $this->belongsTo(User::class); 28 | } 29 | 30 | function statusable() : MorphTo { 31 | return $this->morphTo(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Models/Tag.php: -------------------------------------------------------------------------------- 1 | morphTo(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | is_super_admin ? true : null; 29 | }); 30 | 31 | try { 32 | View::share('globalSettings', [ 33 | 'general' => Setting::getValues('general') 34 | ]); 35 | } catch (\Throwable $th) { 36 | //throw $th; 37 | } 38 | 39 | // Event::listen(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Repositories/CountryRepository.php: -------------------------------------------------------------------------------- 1 | model = $model; 14 | } 15 | 16 | public function getPhoneCodeOptions() { 17 | $countries = $this->model->query()->distinct('phone_code')->get(); 18 | $options = []; 19 | foreach ($countries as $country) { 20 | $options[] = ['id' => $country->id, 'key' => $country->id, 'phone_code' => $country->phone_code, 'value' => $country->phone_code, 'label' => $country->phone_code, 'country_name' => $country->name]; 21 | } 22 | return $options; 23 | } 24 | } -------------------------------------------------------------------------------- /app/Repositories/MenuRepository.php: -------------------------------------------------------------------------------- 1 | model = $model; 15 | } 16 | 17 | public function getPageListForMenu() 18 | { 19 | $pages = Page::select('id', 'slug', 'title', 'status', 'created_at')->published()->latest()->orderBy('title')->get(); 20 | $pages->transform(function ($page) { 21 | return [ 22 | 'id' => $page->id, 23 | 'url' => $page->url, 24 | 'label' => $page->title, 25 | 'title' => $page->title, 26 | 'link_type' => 'page', 27 | 'route_name' => 'page', 28 | 'slug' => $page->slug, 29 | 'route_params' => ['slug' => $page->slug], 30 | ]; 31 | }); 32 | $pages->prepend([ 33 | 'id' => 'blog-page', 34 | 'url' => '/blog', 35 | 'label' => 'Blog', 36 | 'title' => 'Blog', 37 | 'link_type' => 'blog', 38 | 'route_name' => 'blog.index', 39 | 'slug' => 'blog', 40 | 'route_params' => [], 41 | ]); 42 | 43 | return $pages; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Repositories/PostCategoryRepository.php: -------------------------------------------------------------------------------- 1 | model = $model; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Repositories/PostRepository.php: -------------------------------------------------------------------------------- 1 | model = $model; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Repositories/TagRepository.php: -------------------------------------------------------------------------------- 1 | model = $model; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Traits/ActivityLoggable.php: -------------------------------------------------------------------------------- 1 | user(); 14 | $title = $this->title ? $this->title : ($this->name ? $this->name : $this->full_name); 15 | $modelName = class_basename(get_class($this)); 16 | return LogOptions::defaults() 17 | ->logAll() 18 | ->logExcept(['password']) 19 | ->setDescriptionForEvent(function(string $eventName) use($user, $title, $modelName) { 20 | $eventName = ucwords($eventName); 21 | if($user) { 22 | return "{$eventName} - {$modelName} - {$title} (#{$this->id}). By User : {$user->full_name} (#{$user->id})."; 23 | } 24 | 25 | return "{$eventName} - {$modelName} - {$title} (#{$this->id})."; 26 | }); 27 | } 28 | } -------------------------------------------------------------------------------- /app/Traits/HasSlug.php: -------------------------------------------------------------------------------- 1 | where('slug', $slug); 12 | } 13 | 14 | public function setSlugAttribute($value) 15 | { 16 | if($this->id == null) { 17 | $count = $this->where('slug', 'like', $value.'%')->count(); 18 | } else { 19 | if($value == $this->slug) return; 20 | 21 | $count = $this->where('slug', 'like', $value.'%')->where('id', '!=', $this->id)->count(); 22 | } 23 | 24 | if($count == 0) { 25 | $this->attributes['slug'] = $value; 26 | } 27 | else { 28 | $count++; 29 | $this->attributes['slug'] = $count ? "{$value}-{$count}" : $value; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /app/Traits/HasStatuses.php: -------------------------------------------------------------------------------- 1 | morphMany(Status::class, 'statusable')->latest(); 13 | } 14 | 15 | function latestStatus() : MorphOne { 16 | return $this->morphOne(Status::class, 'statusable')->latestOfMany(); 17 | } 18 | } -------------------------------------------------------------------------------- /app/Traits/TaggableTrait.php: -------------------------------------------------------------------------------- 1 | morphToMany(Tag::class, 'taggable'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 10 | web: __DIR__.'/../routes/web.php', 11 | commands: __DIR__.'/../routes/console.php', 12 | health: '/up', 13 | ) 14 | ->withMiddleware(function (Middleware $middleware) { 15 | $middleware->web(append: [ 16 | \App\Http\Middleware\HandleInertiaRequests::class, 17 | \Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class, 18 | ]); 19 | 20 | $middleware->alias([ 21 | 'role' => \Spatie\Permission\Middleware\RoleMiddleware::class, 22 | 'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class, 23 | 'role_or_permission' => \Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class, 24 | ]); 25 | // 26 | }) 27 | ->withExceptions(function (Exceptions $exceptions) { 28 | // 29 | })->create(); 30 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /bootstrap/providers.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'token' => env('POSTMARK_TOKEN'), 19 | ], 20 | 21 | 'ses' => [ 22 | 'key' => env('AWS_ACCESS_KEY_ID'), 23 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 24 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 25 | ], 26 | 27 | 'slack' => [ 28 | 'notifications' => [ 29 | 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'), 30 | 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'), 31 | ], 32 | ], 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class UserFactory extends Factory 13 | { 14 | /** 15 | * The current password being used by the factory. 16 | */ 17 | protected static ?string $password; 18 | 19 | /** 20 | * Define the model's default state. 21 | * 22 | * @return array 23 | */ 24 | public function definition(): array 25 | { 26 | return [ 27 | 'name' => fake()->name(), 28 | 'email' => fake()->unique()->safeEmail(), 29 | 'email_verified_at' => now(), 30 | 'password' => static::$password ??= Hash::make('password'), 31 | 'remember_token' => Str::random(10), 32 | ]; 33 | } 34 | 35 | /** 36 | * Indicate that the model's email address should be unverified. 37 | */ 38 | public function unverified(): static 39 | { 40 | return $this->state(fn (array $attributes) => [ 41 | 'email_verified_at' => null, 42 | ]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000001_create_cache_table.php: -------------------------------------------------------------------------------- 1 | string('key')->primary(); 16 | $table->mediumText('value'); 17 | $table->integer('expiration'); 18 | }); 19 | 20 | Schema::create('cache_locks', function (Blueprint $table) { 21 | $table->string('key')->primary(); 22 | $table->string('owner'); 23 | $table->integer('expiration'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | */ 30 | public function down(): void 31 | { 32 | Schema::dropIfExists('cache'); 33 | Schema::dropIfExists('cache_locks'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2024_04_15_114830_create_categories_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->unsignedBigInteger('parent_id')->index()->nullable(); 17 | $table->string('name')->index(); 18 | $table->string('slug')->unique()->index(); 19 | $table->timestamps(); 20 | $table->softDeletes(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down(): void 28 | { 29 | Schema::dropIfExists('categories'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2024_04_16_094020_create_roles_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('title')->index(); 17 | $table->boolean('status')->default(1)->index(); 18 | $table->timestamps(); 19 | $table->softDeletes(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('roles'); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /database/migrations/2024_04_16_094424_add_role_id_column_in_users_table.php: -------------------------------------------------------------------------------- 1 | foreignId('role_id')->nullable()->index()->after('remember_token')->constrained('roles'); 16 | }); 17 | } 18 | 19 | /** 20 | * Reverse the migrations. 21 | */ 22 | public function down(): void 23 | { 24 | Schema::table('users', function (Blueprint $table) { 25 | $table->dropForeign('users_role_id_foreign'); 26 | $table->dropColumn('role_id'); 27 | }); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /database/migrations/2024_04_19_044457_create_activity_log_table.php: -------------------------------------------------------------------------------- 1 | create(config('activitylog.table_name'), function (Blueprint $table) { 12 | $table->bigIncrements('id'); 13 | $table->string('log_name')->nullable(); 14 | $table->text('description'); 15 | $table->nullableMorphs('subject', 'subject'); 16 | $table->nullableMorphs('causer', 'causer'); 17 | $table->json('properties')->nullable(); 18 | $table->timestamps(); 19 | $table->index('log_name'); 20 | }); 21 | } 22 | 23 | public function down() 24 | { 25 | Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name')); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /database/migrations/2024_04_19_044458_add_event_column_to_activity_log_table.php: -------------------------------------------------------------------------------- 1 | table(config('activitylog.table_name'), function (Blueprint $table) { 12 | $table->string('event')->nullable()->after('subject_type'); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) { 19 | $table->dropColumn('event'); 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /database/migrations/2024_04_19_044459_add_batch_uuid_column_to_activity_log_table.php: -------------------------------------------------------------------------------- 1 | table(config('activitylog.table_name'), function (Blueprint $table) { 12 | $table->uuid('batch_uuid')->nullable()->after('properties'); 13 | }); 14 | } 15 | 16 | public function down() 17 | { 18 | Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) { 19 | $table->dropColumn('batch_uuid'); 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /database/migrations/2024_04_21_164513_create_notes_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('title'); 17 | $table->string('content')->nullable(); 18 | $table->timestamps(); 19 | $table->softDeletes(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('notes'); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /database/migrations/2024_04_22_161338_create_attachments_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('user_id'); 17 | $table->nullableMorphs('attachmentable'); 18 | $table->string('name'); 19 | $table->string('path'); 20 | $table->string('extension')->nullable(); 21 | $table->string('size')->nullable(); 22 | $table->string('mime_type')->nullable(); 23 | $table->string('url')->nullable(); 24 | $table->timestamps(); 25 | $table->softDeletes(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | */ 32 | public function down(): void 33 | { 34 | Schema::dropIfExists('attachments'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2024_04_23_125031_create_clients_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('title'); 17 | $table->string('first_name'); 18 | $table->string('last_name')->nullable(); 19 | $table->string('company_name')->nullable(); 20 | 21 | $table->string('email')->nullable(); 22 | $table->string('phone_code')->nullable(); 23 | $table->string('phone')->nullable(); 24 | 25 | $table->string('email2')->nullable(); 26 | $table->string('phone2_code')->nullable(); 27 | $table->string('phone2')->nullable(); 28 | 29 | $table->foreignId('city_id')->nullOnDelete(); 30 | $table->string('address')->nullable(); 31 | 32 | $table->date('dob')->nullable(); 33 | $table->date('marriage_anniversary')->nullable(); 34 | 35 | $table->timestamps(); 36 | $table->softDeletes(); 37 | }); 38 | } 39 | 40 | /** 41 | * Reverse the migrations. 42 | */ 43 | public function down(): void 44 | { 45 | Schema::dropIfExists('clients'); 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /database/migrations/2024_04_24_053806_drop_roles_table.php: -------------------------------------------------------------------------------- 1 | dropForeign('users_role_id_foreign'); 16 | $table->dropColumn('role_id'); 17 | }); 18 | Schema::dropIfExists('roles'); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down(): void 25 | { 26 | Schema::table('users', function (Blueprint $table) { 27 | $table->foreignId('role_id')->nullable()->index()->after('remember_token')->constrained('roles'); 28 | }); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /database/migrations/2024_04_25_095056_create_comments_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->foreignId('user_id')->constrained(); 17 | $table->morphs('commentable'); 18 | $table->text('body'); 19 | $table->timestamps(); 20 | $table->softDeletes(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down(): void 28 | { 29 | Schema::dropIfExists('comments'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2024_04_25_163359_create_statuses_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->foreignId('user_id')->constrained(); 17 | $table->string('status')->default('Pending'); 18 | $table->text('body')->nullable(); 19 | $table->morphs('statusable'); 20 | $table->timestamps(); 21 | $table->softDeletes(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('statuses'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2024_04_26_174546_add_group_column_in_permissions_table.php: -------------------------------------------------------------------------------- 1 | string('group_name')->nullable()->after('name'); 16 | }); 17 | } 18 | 19 | /** 20 | * Reverse the migrations. 21 | */ 22 | public function down(): void 23 | { 24 | Schema::table('permissions', function (Blueprint $table) { 25 | $table->dropColumn('group_name'); 26 | }); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /database/migrations/2024_04_29_184717_add_user_id_column_in_notes_table.php: -------------------------------------------------------------------------------- 1 | foreignId('user_id')->nullable()->after('id')->index()->constrained(); 16 | }); 17 | } 18 | 19 | /** 20 | * Reverse the migrations. 21 | */ 22 | public function down(): void 23 | { 24 | Schema::table('notes', function (Blueprint $table) { 25 | $table->dropForeign(['user_id']); 26 | $table->dropColumn('user_id'); 27 | }); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /database/migrations/2024_05_09_100901_create_countries_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name', 36); 17 | $table->string('iso3', 5); 18 | $table->string('iso2', 5); 19 | $table->integer('numeric_code'); 20 | $table->string('phone_code', 16); 21 | $table->string('capital', 20)->nullable(); 22 | $table->string('currency', 5); 23 | $table->string('currency_name', 39); 24 | $table->string('currency_symbol', 6); 25 | $table->string('tld', 3); 26 | $table->string('region', 8)->nullable(); 27 | $table->string('subregion', 25)->nullable(); 28 | $table->decimal('latitude', 13, 8); 29 | $table->decimal('longitude', 13, 8); 30 | $table->string('emoji', 4); 31 | $table->string('emojiU', 15); 32 | $table->boolean('status')->default(1); 33 | $table->timestamps(); 34 | $table->softDeletes(); 35 | }); 36 | } 37 | 38 | /** 39 | * Reverse the migrations. 40 | */ 41 | public function down(): void 42 | { 43 | Schema::dropIfExists('countries'); 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /database/migrations/2024_05_09_100906_create_states_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name', 56); 17 | $table->foreignId('country_id')->constrained('countries')->cascadeOnDelete()->cascadeOnUpdate(); 18 | $table->string("country_code", 10); 19 | $table->string("country_name", 36); 20 | $table->string("state_code", 5); 21 | $table->string("type", 45)->nullable(); 22 | $table->decimal('latitude', 13, 8)->nullable(); 23 | $table->decimal('longitude', 13, 8)->nullable(); 24 | $table->string("gst_code", 3)->nullable(); 25 | $table->boolean("status")->default(1); 26 | $table->timestamps(); 27 | $table->softDeletes(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | */ 34 | public function down(): void 35 | { 36 | Schema::dropIfExists('states'); 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /database/migrations/2024_05_09_100910_create_cities_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string("name", 60); 17 | $table->foreignId('state_id')->constrained('states')->cascadeOnDelete()->cascadeOnUpdate(); 18 | $table->string('state_code', 5); 19 | $table->string('state_name', 56); 20 | $table->foreignId('country_id')->constrained('countries')->cascadeOnDelete()->cascadeOnUpdate(); 21 | $table->string('country_code', 2); 22 | $table->string('country_name', 32); 23 | $table->decimal('latitude', 13, 8)->nullable(); 24 | $table->decimal('longitude', 13, 8)->nullable(); 25 | $table->string('wiki_data_id', 10)->nullable(); 26 | $table->boolean('status')->default(1); 27 | $table->timestamps(); 28 | $table->softDeletes(); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | */ 35 | public function down(): void 36 | { 37 | Schema::dropIfExists('cities'); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /database/migrations/2024_07_15_075617_create_pages_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->foreignId('user_id')->constrained(); 17 | $table->string('title')->index(); 18 | $table->string('slug')->unique()->index(); 19 | $table->text('body')->nullable(); 20 | $table->boolean('status')->default(1); 21 | $table->integer('views')->default(0); 22 | $table->string('meta_title')->nullable()->index(); 23 | $table->string('meta_description')->nullable()->index(); 24 | $table->timestamps(); 25 | $table->softDeletes(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | */ 32 | public function down(): void 33 | { 34 | Schema::dropIfExists('pages'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2024_07_15_075657_create_posts_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->foreignId('user_id')->constrained(); 17 | $table->string('title')->index(); 18 | $table->string('slug')->unique()->index(); 19 | $table->text('body')->nullable(); 20 | $table->boolean('status')->default(1); 21 | $table->integer('views')->default(0); 22 | $table->string('meta_title')->nullable()->index(); 23 | $table->string('meta_description')->nullable()->index(); 24 | $table->timestamps(); 25 | $table->softDeletes(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | */ 32 | public function down(): void 33 | { 34 | Schema::dropIfExists('pages'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2024_08_12_201453_add_puck_body_column_in_pages_table.php: -------------------------------------------------------------------------------- 1 | json('puck_body')->nullable()->after('body'); 16 | }); 17 | } 18 | 19 | /** 20 | * Reverse the migrations. 21 | */ 22 | public function down(): void 23 | { 24 | Schema::table('pages', function (Blueprint $table) { 25 | $table->dropColumn('puck_body'); 26 | }); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /database/migrations/2024_08_26_163152_add_indexes_in_pages_table.php: -------------------------------------------------------------------------------- 1 | index('views'); 16 | $table->index('status'); 17 | $table->index('created_at'); 18 | $table->index('updated_at'); 19 | $table->index('deleted_at'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::table('pages', function (Blueprint $table) { 29 | $table->dropIndex(['views']); 30 | $table->dropIndex(['status']); 31 | $table->dropIndex(['created_at']); 32 | $table->dropIndex(['updated_at']); 33 | $table->dropIndex(['deleted_at']); 34 | }); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2024_08_26_163726_add_indexes_in_posts_table.php: -------------------------------------------------------------------------------- 1 | index('views'); 16 | $table->index('status'); 17 | $table->index('created_at'); 18 | $table->index('updated_at'); 19 | $table->index('deleted_at'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::table('posts', function (Blueprint $table) { 29 | $table->dropIndex(['views']); 30 | $table->dropIndex(['status']); 31 | $table->dropIndex(['created_at']); 32 | $table->dropIndex(['updated_at']); 33 | $table->dropIndex(['deleted_at']); 34 | }); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2024_08_27_163240_create_menus_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->foreignId('user_id')->constrained(); 17 | $table->string('name')->index(); 18 | $table->string('slug')->unique()->index(); 19 | $table->json('items')->nullable(); 20 | $table->timestamps(); 21 | $table->softDeletes(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('menus'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2024_09_11_201454_create_setting_groups_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('parent_id')->nullable(); 17 | $table->string('key')->unique(); 18 | $table->string('name'); 19 | $table->string('description')->nullable(); 20 | $table->string('order')->default(0); 21 | $table->timestamps(); 22 | $table->softDeletes(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('setting_groups'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /database/migrations/2024_09_11_201455_create_settings_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->foreignId('setting_group_id')->constrained()->cascadeOnDelete(); 17 | $table->string('name')->index(); 18 | $table->string('description')->nullable(); 19 | $table->string('key')->unique(); 20 | $table->longText('value')->nullable(); 21 | $table->string('type')->nullable()->index(); 22 | $table->tinyInteger('order')->default(0)->index(); 23 | $table->timestamps(); 24 | $table->softDeletes(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | */ 31 | public function down(): void 32 | { 33 | Schema::dropIfExists('settings'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2024_09_18_132142_add_short_description_column_in_posts_table.php: -------------------------------------------------------------------------------- 1 | text('short_description')->nullable(); 16 | }); 17 | } 18 | 19 | /** 20 | * Reverse the migrations. 21 | */ 22 | public function down(): void 23 | { 24 | Schema::table('posts', function (Blueprint $table) { 25 | $table->dropColumn('short_description'); 26 | }); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /database/migrations/2024_09_18_133308_create_post_categories_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete(); 17 | $table->string('name'); 18 | $table->string('slug')->unique()->index(); 19 | $table->string('description')->nullable(); 20 | $table->string('meta_title')->nullable()->index(); 21 | $table->string('meta_description')->nullable()->index(); 22 | $table->timestamps(); 23 | $table->softDeletes(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | */ 30 | public function down(): void 31 | { 32 | Schema::dropIfExists('post_categories'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /database/migrations/2024_09_18_134102_create_post_post_category_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->foreignId('post_id')->constrained(); 17 | $table->foreignId('post_category_id')->constrained(); 18 | $table->timestamps(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | */ 25 | public function down(): void 26 | { 27 | Schema::dropIfExists('post_post_category'); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /database/migrations/2024_09_18_134104_add_relation_type_column_in_attachments_table.php: -------------------------------------------------------------------------------- 1 | enum('relation_type', ['attachment', 'image'])->nullable()->after('name'); 16 | }); 17 | } 18 | 19 | /** 20 | * Reverse the migrations. 21 | */ 22 | public function down(): void 23 | { 24 | Schema::table('attachments', function (Blueprint $table) { 25 | $table->dropColumn('relation_type'); 26 | }); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /database/migrations/2024_10_13_100430_create_tags_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->timestamps(); 18 | $table->softDeletes(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | */ 25 | public function down(): void 26 | { 27 | Schema::dropIfExists('tags'); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /database/migrations/2024_10_13_100910_create_taggables_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->morphs('taggable'); 17 | $table->foreignId('tag_id')->constrained('tags'); 18 | $table->timestamps(); 19 | $table->softDeletes(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('taggables'); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /database/seeders/CitySeeder.php: -------------------------------------------------------------------------------- 1 | find($data['id']); 21 | 22 | if (!$checkRecordExists) { 23 | DB::table('cities')->insert([ 24 | "id" => $data['id'], 25 | "name" => $data['name'], 26 | "state_id" => $data['state_id'], 27 | "state_code" => $data['state_code'], 28 | "state_name" => $data['state_name'], 29 | "country_id" => $data['country_id'], 30 | "country_code" => $data['country_code'], 31 | "country_name" => $data['country_name'], 32 | "latitude" => $data['latitude'] ?? null, 33 | "longitude" => $data['longitude'] ?? null, 34 | "wiki_data_id" => $data['wikiDataId'] ?? "", 35 | "status" => 1, 36 | "created_at" => now(), 37 | "updated_at" => now(), 38 | ]); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 15 | 16 | // User::factory()->create([ 17 | // 'name' => 'Test User', 18 | // 'email' => 'test@example.com', 19 | // ]); 20 | 21 | $this->call([ 22 | RoleSeeder::class, 23 | UserSeeder::class, 24 | PageSeeder::class, 25 | CountrySeeder::class, 26 | StateSeeder::class, 27 | CitySeeder::class, 28 | SettingSeeder::class, 29 | ]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/seeders/PageSeeder.php: -------------------------------------------------------------------------------- 1 | 1, 18 | 'title' => 'Home', 19 | 'slug' => 'home', 20 | 'body' => null, 21 | 'puck_body' => [ 22 | 'content' => [], 23 | 'root' => [], 24 | ], 25 | 'status' => 1 26 | ]); 27 | Page::firstOrCreate([ 28 | 'user_id' => 1, 29 | 'title' => 'About Us', 30 | 'slug' => 'about-us', 31 | 'body' => null, 32 | 'puck_body' => [ 33 | 'content' => [], 34 | 'root' => [], 35 | ], 36 | 'status' => 1 37 | ]); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /database/seeders/RoleSeeder.php: -------------------------------------------------------------------------------- 1 | disableLogging(); 21 | Schema::disableForeignKeyConstraints(); 22 | DB::table('roles')->truncate(); 23 | DB::table('permissions')->truncate(); 24 | DB::table('role_has_permissions')->truncate(); 25 | DB::table('model_has_permissions')->truncate(); 26 | DB::table('model_has_roles')->truncate(); 27 | 28 | $adminRole = Role::create(['name' => 'admin']); 29 | $moderator = Role::create(['name' => 'moderator']); 30 | $user = Role::create(['name' => 'user']); 31 | 32 | Schema::disableForeignKeyConstraints(); 33 | activity()->enableLogging(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/seeders/UserSeeder.php: -------------------------------------------------------------------------------- 1 | disableLogging(); 19 | Schema::disableForeignKeyConstraints(); 20 | DB::table('users')->truncate(); 21 | $superAdmin = User::create([ 22 | 'first_name' => 'Super', 23 | 'last_name' => 'Admin', 24 | 'email' => 'admin@admin.com', 25 | 'password' => bcrypt('123456789'), 26 | 'email_verified_at' => now(), 27 | 'created_at' => now(), 28 | 'updated_at' => now(), 29 | 'deleted_at' => null, 30 | ]); 31 | 32 | $superAdmin->assignRole('admin'); 33 | 34 | Schema::disableForeignKeyConstraints(); 35 | activity()->enableLogging(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "@/*": ["resources/js/*"], 6 | "ziggy-js": ["./vendor/tightenco/ziggy"] 7 | } 8 | }, 9 | "exclude": ["node_modules", "public"] 10 | } 11 | -------------------------------------------------------------------------------- /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 | 33 | 34 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /public/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/.DS_Store -------------------------------------------------------------------------------- /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/fav/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/.DS_Store -------------------------------------------------------------------------------- /public/fav/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/android-icon-144x144.png -------------------------------------------------------------------------------- /public/fav/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/android-icon-192x192.png -------------------------------------------------------------------------------- /public/fav/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/android-icon-36x36.png -------------------------------------------------------------------------------- /public/fav/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/android-icon-48x48.png -------------------------------------------------------------------------------- /public/fav/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/android-icon-72x72.png -------------------------------------------------------------------------------- /public/fav/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/android-icon-96x96.png -------------------------------------------------------------------------------- /public/fav/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-114x114.png -------------------------------------------------------------------------------- /public/fav/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-120x120.png -------------------------------------------------------------------------------- /public/fav/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-144x144.png -------------------------------------------------------------------------------- /public/fav/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-152x152.png -------------------------------------------------------------------------------- /public/fav/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-180x180.png -------------------------------------------------------------------------------- /public/fav/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-57x57.png -------------------------------------------------------------------------------- /public/fav/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-60x60.png -------------------------------------------------------------------------------- /public/fav/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-72x72.png -------------------------------------------------------------------------------- /public/fav/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-76x76.png -------------------------------------------------------------------------------- /public/fav/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon-precomposed.png -------------------------------------------------------------------------------- /public/fav/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/apple-icon.png -------------------------------------------------------------------------------- /public/fav/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /public/fav/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/favicon-16x16.png -------------------------------------------------------------------------------- /public/fav/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/favicon-32x32.png -------------------------------------------------------------------------------- /public/fav/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/favicon-96x96.png -------------------------------------------------------------------------------- /public/fav/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/favicon.ico -------------------------------------------------------------------------------- /public/fav/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /public/fav/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/ms-icon-144x144.png -------------------------------------------------------------------------------- /public/fav/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/ms-icon-150x150.png -------------------------------------------------------------------------------- /public/fav/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/ms-icon-310x310.png -------------------------------------------------------------------------------- /public/fav/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/fav/ms-icon-70x70.png -------------------------------------------------------------------------------- /public/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/images/.DS_Store -------------------------------------------------------------------------------- /public/images/lis-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/images/lis-dark.png -------------------------------------------------------------------------------- /public/images/lis-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeRomeos/laravel-inertia-react-shadcn-boilerplate/3121e32aa74380ee8413748a9158de64718acb0c/public/images/lis-white.png -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/js/Components/Activities/ActivityLogs.jsx: -------------------------------------------------------------------------------- 1 | import { Avatar, AvatarFallback } from "@/shadcn/ui/avatar"; 2 | import { format } from "date-fns"; 3 | import { CalendarDays } from "lucide-react"; 4 | 5 | export default function ActivityList({ activities }) { 6 | return ( 7 |
8 |
9 | {activities.map((activity) => ( 10 |
11 |
12 | 13 | 14 | {activity.causer.full_name[0]} 15 | 16 | 17 |

18 | {activity.causer.full_name} 19 |

20 | 21 | {format(activity.created_at, "PPpp")} 22 | 23 |
24 |

{activity.description}

25 |
26 | ))} 27 |
28 |
29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /resources/js/Components/Admin/AdminGlobalHeader.jsx: -------------------------------------------------------------------------------- 1 | import { Link, usePage } from "@inertiajs/react"; 2 | import { PencilIcon } from "lucide-react"; 3 | import React from "react"; 4 | 5 | export default function AdminGlobalHeader() { 6 | const { url, component } = usePage(); 7 | const { page } = usePage().props; 8 | return ( 9 |
10 |
11 |
12 | {(component === 'Page' || component === 'Homepage') && 15 | Edit Page 16 | } 17 |
18 |
19 | Dashboard 20 |
21 |
22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /resources/js/Components/Admin/MainSiteIconLink.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Button } from "@/shadcn/ui/button"; 3 | import { 4 | Tooltip, 5 | TooltipContent, 6 | TooltipProvider, 7 | TooltipTrigger, 8 | } from "@/shadcn/ui/tooltip"; 9 | import { PanelTopIcon } from 'lucide-react'; 10 | 11 | export default function MainSiteIconLink() { 12 | return ( 13 | 14 | 15 | 16 | 21 | 22 | 23 |

View main site

24 |
25 |
26 |
27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /resources/js/Components/ApplicationLogo.jsx: -------------------------------------------------------------------------------- 1 | import { Link, usePage } from "@inertiajs/react"; 2 | 3 | export default function ApplicationLogo({ imgClass = "", textClass = "" }) { 4 | const { appName, globalSettings } = usePage().props; 5 | return ( 6 | 10 | {globalSettings.general.app_logo 11 | ? {globalSettings.general.app_logo 18 | :

{globalSettings.general.app_name || appName}

19 | } 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /resources/js/Components/Attachments/AttachmentGrid.jsx: -------------------------------------------------------------------------------- 1 | import AttachmentThumbnail from "./AttachmentThumbnail"; 2 | 3 | export default function AttachmentGrid({attachments}) { 4 | return ( 5 |
6 | {attachments.length > 0 && ( 7 |
8 | {attachments.map((attachment, index) => ( 9 | 13 | ))} 14 |
15 | )} 16 |
17 | ); 18 | } -------------------------------------------------------------------------------- /resources/js/Components/Attachments/AttachmentThumbnail.jsx: -------------------------------------------------------------------------------- 1 | import { Download, File } from 'lucide-react'; 2 | import React from 'react' 3 | 4 | export default function AttachmentThumbnail({ attachment }) { 5 | return ( 6 | 12 | {/* */} 13 | 14 |
15 |
16 | {["jpg", "jpeg", "png", "webp", "gif", "tiff"].includes( 17 | attachment.extension 18 | ) ? ( 19 | {attachment.name} 27 | ) : ( 28 | 29 | )} 30 |

31 | {attachment.name} 32 |

33 |
34 |
35 |
36 | ); 37 | } -------------------------------------------------------------------------------- /resources/js/Components/Attachments/UploadAttachmentsForm.jsx: -------------------------------------------------------------------------------- 1 | import { Button } from "@/shadcn/ui/button"; 2 | import { Input } from "@/shadcn/ui/input"; 3 | import { useForm } from "@inertiajs/react"; 4 | import InputError from "../InputError"; 5 | import { Loader2 } from "lucide-react"; 6 | 7 | export default function UploadAttachmentsForm({ action }) { 8 | const { data, setData, post, processing, errors, reset } = useForm({ 9 | attachments: "", 10 | }); 11 | 12 | const uploadAttachment = (e) => { 13 | e.preventDefault(); 14 | post(action); 15 | reset(); 16 | }; 17 | 18 | return ( 19 |
20 |
21 | { 29 | setData("attachments", e.target.files); 30 | }} 31 | /> 32 | 38 |
39 | 40 | 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /resources/js/Components/Can.jsx: -------------------------------------------------------------------------------- 1 | import { usePage } from "@inertiajs/react"; 2 | 3 | export const hasPermisions = (auth, permit) => { 4 | return auth.user.is_super_admin || 5 | // auth.userPermissions.includes(permit) || 6 | permit.split("|").filter(function (n) { 7 | return auth.userPermissions.indexOf(n) !== -1; 8 | }).length > 0 9 | ; 10 | } 11 | 12 | export default function Can({permit, children, fallback = null}) { 13 | const {auth} = usePage().props; 14 | 15 | if (hasPermisions(auth, permit)) { 16 | return children; 17 | } 18 | 19 | return fallback; 20 | } -------------------------------------------------------------------------------- /resources/js/Components/Charts/DebitCreditBarChartSmall.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | BarChart, 4 | Bar, 5 | ResponsiveContainer, 6 | Tooltip, 7 | } from "recharts"; 8 | 9 | 10 | export default function DebitCreditBarChartSmall({data}) { 11 | return ( 12 | 13 | 14 | {/* */} 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /resources/js/Components/Checkbox.jsx: -------------------------------------------------------------------------------- 1 | export default function Checkbox({ className = '', ...props }) { 2 | return ( 3 | 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /resources/js/Components/Comments/CommentForm.jsx: -------------------------------------------------------------------------------- 1 | import { Button } from "@/shadcn/ui/button"; 2 | import { Textarea } from "@/shadcn/ui/textarea"; 3 | import { useForm } from "@inertiajs/react"; 4 | 5 | export default function CommentForm({ modelType, modelId }) { 6 | const { data, setData, post, processing, errors, reset } = useForm({ 7 | body: "", 8 | model_type: modelType, 9 | model_id: modelId, 10 | }); 11 | 12 | const submit = (e) => { 13 | e.preventDefault(); 14 | post(route("comments.store")); 15 | reset(); 16 | }; 17 | 18 | return ( 19 |
20 |
21 |