├── .editorconfig
├── .env.example
├── .gitattributes
├── .github
├── CONTRIBUTING.md
├── FUNDING.yml
├── ISSUE_TEMPLATE.md
├── stale.yml
└── workflows
│ └── main.yml
├── .gitignore
├── .php_cs
├── .styleci.yml
├── README.md
├── app
├── Console
│ └── Kernel.php
├── Domains
│ ├── Announcement
│ │ ├── Models
│ │ │ ├── Announcement.php
│ │ │ └── Traits
│ │ │ │ └── Scope
│ │ │ │ └── AnnouncementScope.php
│ │ └── Services
│ │ │ └── AnnouncementService.php
│ └── Auth
│ │ ├── Events
│ │ ├── Role
│ │ │ ├── RoleCreated.php
│ │ │ ├── RoleDeleted.php
│ │ │ └── RoleUpdated.php
│ │ └── User
│ │ │ ├── UserCreated.php
│ │ │ ├── UserDeleted.php
│ │ │ ├── UserDestroyed.php
│ │ │ ├── UserLoggedIn.php
│ │ │ ├── UserRestored.php
│ │ │ ├── UserStatusChanged.php
│ │ │ └── UserUpdated.php
│ │ ├── Http
│ │ ├── Controllers
│ │ │ ├── Backend
│ │ │ │ ├── Role
│ │ │ │ │ └── RoleController.php
│ │ │ │ └── User
│ │ │ │ │ ├── DeactivatedUserController.php
│ │ │ │ │ ├── DeletedUserController.php
│ │ │ │ │ ├── UserController.php
│ │ │ │ │ ├── UserPasswordController.php
│ │ │ │ │ └── UserSessionController.php
│ │ │ └── Frontend
│ │ │ │ └── Auth
│ │ │ │ ├── ConfirmPasswordController.php
│ │ │ │ ├── DisableTwoFactorAuthenticationController.php
│ │ │ │ ├── ForgotPasswordController.php
│ │ │ │ ├── LoginController.php
│ │ │ │ ├── PasswordExpiredController.php
│ │ │ │ ├── RegisterController.php
│ │ │ │ ├── ResetPasswordController.php
│ │ │ │ ├── SocialController.php
│ │ │ │ ├── TwoFactorAuthenticationController.php
│ │ │ │ ├── UpdatePasswordController.php
│ │ │ │ └── VerificationController.php
│ │ ├── Middleware
│ │ │ ├── AdminCheck.php
│ │ │ ├── PasswordExpires.php
│ │ │ ├── SuperAdminCheck.php
│ │ │ ├── ToBeLoggedOut.php
│ │ │ ├── TwoFactorAuthenticationStatus.php
│ │ │ ├── UserCheck.php
│ │ │ └── UserTypeCheck.php
│ │ └── Requests
│ │ │ ├── Backend
│ │ │ ├── Role
│ │ │ │ ├── DeleteRoleRequest.php
│ │ │ │ ├── EditRoleRequest.php
│ │ │ │ ├── StoreRoleRequest.php
│ │ │ │ └── UpdateRoleRequest.php
│ │ │ └── User
│ │ │ │ ├── ClearUserSessionRequest.php
│ │ │ │ ├── DeleteUserRequest.php
│ │ │ │ ├── EditUserPasswordRequest.php
│ │ │ │ ├── EditUserRequest.php
│ │ │ │ ├── StoreUserRequest.php
│ │ │ │ ├── UpdateUserPasswordRequest.php
│ │ │ │ └── UpdateUserRequest.php
│ │ │ └── Frontend
│ │ │ └── Auth
│ │ │ ├── DisableTwoFactorAuthenticationRequest.php
│ │ │ └── UpdatePasswordRequest.php
│ │ ├── Listeners
│ │ ├── RoleEventListener.php
│ │ └── UserEventListener.php
│ │ ├── Models
│ │ ├── PasswordHistory.php
│ │ ├── Permission.php
│ │ ├── Role.php
│ │ ├── Traits
│ │ │ ├── Attribute
│ │ │ │ ├── RoleAttribute.php
│ │ │ │ └── UserAttribute.php
│ │ │ ├── Method
│ │ │ │ ├── RoleMethod.php
│ │ │ │ └── UserMethod.php
│ │ │ ├── Relationship
│ │ │ │ ├── PermissionRelationship.php
│ │ │ │ └── UserRelationship.php
│ │ │ └── Scope
│ │ │ │ ├── PermissionScope.php
│ │ │ │ ├── RoleScope.php
│ │ │ │ └── UserScope.php
│ │ └── User.php
│ │ ├── Notifications
│ │ └── Frontend
│ │ │ ├── ResetPasswordNotification.php
│ │ │ └── VerifyEmail.php
│ │ ├── Observers
│ │ └── UserObserver.php
│ │ ├── Rules
│ │ └── UnusedPassword.php
│ │ └── Services
│ │ ├── PermissionService.php
│ │ ├── RoleService.php
│ │ └── UserService.php
├── Exceptions
│ ├── GeneralException.php
│ ├── Handler.php
│ └── ReportableException.php
├── Helpers
│ └── Global
│ │ ├── GeneralHelper.php
│ │ ├── HtmlHelper.php
│ │ ├── LocaleHelper.php
│ │ ├── SystemHelper.php
│ │ ├── TimezoneHelper.php
│ │ └── _readme.txt
├── Http
│ ├── Controllers
│ │ ├── Backend
│ │ │ └── DashboardController.php
│ │ ├── Controller.php
│ │ ├── Frontend
│ │ │ ├── HomeController.php
│ │ │ ├── TermsController.php
│ │ │ └── User
│ │ │ │ ├── AccountController.php
│ │ │ │ ├── DashboardController.php
│ │ │ │ └── ProfileController.php
│ │ └── LocaleController.php
│ ├── Kernel.php
│ ├── Livewire
│ │ ├── Backend
│ │ │ ├── RolesTable.php
│ │ │ └── UsersTable.php
│ │ └── Frontend
│ │ │ └── TwoFactorAuthentication.php
│ ├── Middleware
│ │ ├── Authenticate.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── EncryptCookies.php
│ │ ├── LocaleMiddleware.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── TrimStrings.php
│ │ ├── TrustHosts.php
│ │ ├── TrustProxies.php
│ │ └── VerifyCsrfToken.php
│ └── Requests
│ │ └── Frontend
│ │ └── User
│ │ └── UpdateProfileRequest.php
├── Models
│ └── Traits
│ │ └── Uuid.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BladeServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── ComposerServiceProvider.php
│ ├── EventServiceProvider.php
│ ├── HelperServiceProvider.php
│ ├── LocaleServiceProvider.php
│ ├── ObserverServiceProvider.php
│ └── RouteServiceProvider.php
├── Rules
│ └── Captcha.php
└── Services
│ └── BaseService.php
├── artisan
├── bootstrap
├── app.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── activitylog.php
├── app.php
├── auth.php
├── boilerplate.php
├── broadcasting.php
├── cache.php
├── cors.php
├── database.php
├── filesystems.php
├── geoip.php
├── hashing.php
├── livewire-tables.php
├── livewire.php
├── lockout.php
├── log-viewer.php
├── logging.php
├── mail.php
├── permission.php
├── queue.php
├── sanctum.php
├── services.php
├── session.php
├── timezone.php
└── view.php
├── database
├── .gitignore
├── factories
│ ├── AnnouncementFactory.php
│ ├── RoleFactory.php
│ └── UserFactory.php
├── migrations
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ ├── 2019_12_14_000001_create_personal_access_tokens_table.php
│ ├── 2020_02_25_034148_create_permission_tables.php
│ ├── 2020_05_25_021239_create_announcements_table.php
│ ├── 2020_05_29_020244_create_password_histories_table.php
│ ├── 2020_07_06_215139_create_activity_log_table.php
│ └── 2021_04_05_153840_create_two_factor_authentications_table.php
└── seeders
│ ├── AnnouncementSeeder.php
│ ├── Auth
│ ├── PermissionRoleSeeder.php
│ ├── UserRoleSeeder.php
│ └── UserSeeder.php
│ ├── AuthSeeder.php
│ ├── DatabaseSeeder.php
│ └── Traits
│ ├── DisableForeignKeys.php
│ └── TruncateTable.php
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── favicon.ico
├── img
│ └── brand
│ │ └── coreui.svg
├── index.php
├── robots.txt
└── web.config
├── resources
├── js
│ ├── backend
│ │ └── app.js
│ ├── bootstrap.js
│ ├── frontend
│ │ ├── app.js
│ │ └── components
│ │ │ └── ExampleComponent.vue
│ └── plugins.js
├── lang
│ ├── ar.json
│ ├── ar
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── az.json
│ ├── az
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── cs.json
│ ├── cs
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── da.json
│ ├── da
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── de.json
│ ├── de
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── el.json
│ ├── el
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── es.json
│ ├── es
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── fa.json
│ ├── fa
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── fr.json
│ ├── fr
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── he.json
│ ├── he
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── id.json
│ ├── id
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── it.json
│ ├── it
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── ja.json
│ ├── ja
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── ko.json
│ ├── ko
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── nl.json
│ ├── nl
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── no.json
│ ├── no
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── pl.json
│ ├── pl
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── pt_BR.json
│ ├── pt_BR
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── pt_PT.json
│ ├── pt_PT
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── ro.json
│ ├── ro
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── ru.json
│ ├── ru
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── sv.json
│ ├── sv
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── th.json
│ ├── th
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── tr.json
│ ├── tr
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── uk.json
│ ├── uk
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── vi.json
│ ├── vi
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── zh-TW.json
│ ├── zh-TW
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ ├── zh.json
│ └── zh
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
├── sass
│ ├── _global.scss
│ ├── backend
│ │ └── app.scss
│ └── frontend
│ │ ├── _global.scss
│ │ ├── _variables.scss
│ │ └── app.scss
└── views
│ ├── backend
│ ├── auth
│ │ ├── includes
│ │ │ ├── partials
│ │ │ │ ├── permission-type.blade.php
│ │ │ │ └── role-type.blade.php
│ │ │ ├── permissions.blade.php
│ │ │ └── roles.blade.php
│ │ ├── role
│ │ │ ├── create.blade.php
│ │ │ ├── edit.blade.php
│ │ │ ├── includes
│ │ │ │ ├── actions.blade.php
│ │ │ │ ├── children.blade.php
│ │ │ │ ├── no-permissions-message.blade.php
│ │ │ │ └── row.blade.php
│ │ │ └── index.blade.php
│ │ └── user
│ │ │ ├── change-password.blade.php
│ │ │ ├── create.blade.php
│ │ │ ├── deactivated.blade.php
│ │ │ ├── deleted.blade.php
│ │ │ ├── edit.blade.php
│ │ │ ├── includes
│ │ │ ├── 2fa.blade.php
│ │ │ ├── actions.blade.php
│ │ │ ├── breadcrumb-links.blade.php
│ │ │ ├── row.blade.php
│ │ │ ├── status.blade.php
│ │ │ ├── type.blade.php
│ │ │ └── verified.blade.php
│ │ │ ├── index.blade.php
│ │ │ └── show.blade.php
│ ├── dashboard.blade.php
│ ├── includes
│ │ ├── footer.blade.php
│ │ ├── header.blade.php
│ │ ├── partials
│ │ │ └── breadcrumbs.blade.php
│ │ └── sidebar.blade.php
│ └── layouts
│ │ └── app.blade.php
│ ├── components
│ ├── backend
│ │ └── card.blade.php
│ ├── forms
│ │ ├── delete.blade.php
│ │ ├── get.blade.php
│ │ ├── patch.blade.php
│ │ └── post.blade.php
│ ├── frontend
│ │ ├── card.blade.php
│ │ └── two-factor-authentication.blade.php
│ └── utils
│ │ ├── alert.blade.php
│ │ ├── delete-button.blade.php
│ │ ├── edit-button.blade.php
│ │ ├── form-button.blade.php
│ │ ├── link.blade.php
│ │ └── view-button.blade.php
│ ├── errors
│ ├── 401.blade.php
│ ├── 403.blade.php
│ ├── 404.blade.php
│ ├── 419.blade.php
│ ├── 429.blade.php
│ ├── 500.blade.php
│ └── 503.blade.php
│ ├── frontend
│ ├── auth
│ │ ├── includes
│ │ │ └── social.blade.php
│ │ ├── login.blade.php
│ │ ├── passwords
│ │ │ ├── confirm.blade.php
│ │ │ ├── email.blade.php
│ │ │ ├── expired.blade.php
│ │ │ └── reset.blade.php
│ │ ├── register.blade.php
│ │ └── verify.blade.php
│ ├── includes
│ │ ├── nav.blade.php
│ │ └── partials
│ │ │ └── breadcrumbs.blade.php
│ ├── index.blade.php
│ ├── layouts
│ │ └── app.blade.php
│ ├── pages
│ │ └── terms.blade.php
│ └── user
│ │ ├── account.blade.php
│ │ ├── account
│ │ └── tabs
│ │ │ ├── information.blade.php
│ │ │ ├── password.blade.php
│ │ │ ├── profile.blade.php
│ │ │ ├── two-factor-authentication.blade.php
│ │ │ └── two-factor-authentication
│ │ │ ├── disable.blade.php
│ │ │ ├── enable.blade.php
│ │ │ └── recovery.blade.php
│ │ └── dashboard.blade.php
│ ├── includes
│ └── partials
│ │ ├── announcements.blade.php
│ │ ├── lang.blade.php
│ │ ├── logged-in-as.blade.php
│ │ ├── messages.blade.php
│ │ └── read-only.blade.php
│ └── vendor
│ ├── laraguard
│ └── auth.blade.php
│ └── log-viewer
│ └── bootstrap-4
│ └── _master.blade.php
├── routes
├── api.php
├── backend
│ ├── admin.php
│ └── auth.php
├── channels.php
├── console.php
├── frontend
│ ├── auth.php
│ ├── home.php
│ └── user.php
└── web.php
├── server.php
├── storage
├── app
│ ├── .gitignore
│ └── public
│ │ └── .gitignore
├── debugbar
│ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ ├── .gitignore
│ │ └── data
│ │ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── testing
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
├── tests
├── CreatesApplication.php
├── Feature
│ ├── Backend
│ │ ├── DashboardTest.php
│ │ ├── Role
│ │ │ ├── CreateRoleTest.php
│ │ │ ├── DeleteRoleTest.php
│ │ │ ├── ListRoleTest.php
│ │ │ └── UpdateRoleTest.php
│ │ └── User
│ │ │ ├── ChangeUserPasswordTest.php
│ │ │ ├── ClearSessionTest.php
│ │ │ ├── CreateUserTest.php
│ │ │ ├── DeactivateReactivateUserTest.php
│ │ │ ├── DeleteUserTest.php
│ │ │ ├── ListUserTest.php
│ │ │ └── UpdateUserTest.php
│ ├── Frontend
│ │ ├── AnnouncementTest.php
│ │ ├── ChangePasswordTest.php
│ │ ├── ConfirmationTest.php
│ │ ├── DashboardTest.php
│ │ ├── HomeTest.php
│ │ ├── LoginTest.php
│ │ ├── LogoutTest.php
│ │ ├── PasswordExpirationTest.php
│ │ ├── RegistrationTest.php
│ │ ├── ResetPasswordTest.php
│ │ ├── UserAccountTest.php
│ │ └── VerificationTest.php
│ └── Middleware
│ │ ├── SwitchLanguageTest.php
│ │ └── ToBeLoggedOutTest.php
└── TestCase.php
├── webpack.mix.js
└── yarn.lock
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.{yml,yaml}]
15 | indent_size = 2
16 |
17 | [docker-compose.yml]
18 | indent_size = 4
19 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
3 | # Enforce Unix newlines
4 | *.css text eol=lf linguist-vendored
5 | *.html text eol=lf
6 | *.js text eol=lf linguist-vendored
7 | *.json text eol=lf
8 | *.md text eol=lf
9 | *.scss text eol=lf linguist-vendored
10 | *.svg text eol=lf
11 | *.txt text eol=lf
12 | *.xml text eol=lf
13 | *.yml text eol=lf
14 |
15 | # Don't diff or textually merge source maps
16 | *.map binary
17 |
18 | CHANGELOG.md export-ignore
19 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [rappasoft]
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | # Before you create an issue make sure that:
2 | - Your issue is **strictly related to the boilerplate** itself. Questions about Laravel in general belongs to the [laravel](http://laravel.io/forum) or [laracasts](https://laracasts.com/discuss/) forums.
3 | - You have read the [documentation](https://laravel-boilerplate.com) thoroughly.
4 | - You have searched for a similar issue among all the former issues (even closed ones).
5 | - You have tried to replicate the issue with a clean install of the project.
6 |
7 | # Be explicit
8 | Try to be as explicit as you can when you ask anything.
9 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Number of days of inactivity before an issue becomes stale
2 | daysUntilStale: 30
3 | # Number of days of inactivity before a stale issue is closed
4 | daysUntilClose: 7
5 | # Issues with these labels will never be considered stale
6 | exemptLabels:
7 | - pinned
8 | - security
9 | # Label to use when marking an issue as stale
10 | staleLabel: wontfix
11 | # Comment to post when marking an issue as stale. Set to `false` to disable
12 | markComment: >
13 | This issue has been automatically marked as stale because it has not had
14 | recent activity. It will be closed if no further activity occurs. Thank you
15 | for your contributions.
16 | # Comment to post when closing a stale issue. Set to `false` to disable
17 | closeComment: false
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /coverage
2 | /node_modules
3 | /public/css
4 | /public/js
5 | /public/fonts
6 | /public/hot
7 | /public/storage
8 | /public/mix-manifest.json
9 | /storage/*.key
10 | /vendor
11 | /.vscode
12 | *.sublime-project
13 | *.sublime-workspace
14 | _ide_helper.php
15 | .DS_Store
16 | .env
17 | .env.backup
18 | .idea
19 | .php_cs.cache
20 | .phpunit.result.cache
21 | .phpstorm.meta.php
22 | .project
23 | composer.phar
24 | coverage.xml
25 | docker-compose.override.yml
26 | error.log
27 | Homestead.json
28 | Homestead.yaml
29 | npm-debug.log
30 | output.txt
31 | Thumbs.db
32 | yarn-error.log
33 |
--------------------------------------------------------------------------------
/.styleci.yml:
--------------------------------------------------------------------------------
1 | preset: laravel
2 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('activitylog:clean')->daily();
31 | }
32 |
33 | /**
34 | * Register the commands for the application.
35 | *
36 | * @return void
37 | */
38 | protected function commands()
39 | {
40 | $this->load(__DIR__.'/Commands');
41 |
42 | require base_path('routes/console.php');
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/Role/RoleCreated.php:
--------------------------------------------------------------------------------
1 | role = $role;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/Role/RoleDeleted.php:
--------------------------------------------------------------------------------
1 | role = $role;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/Role/RoleUpdated.php:
--------------------------------------------------------------------------------
1 | role = $role;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/User/UserCreated.php:
--------------------------------------------------------------------------------
1 | user = $user;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/User/UserDeleted.php:
--------------------------------------------------------------------------------
1 | user = $user;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/User/UserDestroyed.php:
--------------------------------------------------------------------------------
1 | user = $user;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/User/UserLoggedIn.php:
--------------------------------------------------------------------------------
1 | user = $user;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/User/UserRestored.php:
--------------------------------------------------------------------------------
1 | user = $user;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/User/UserStatusChanged.php:
--------------------------------------------------------------------------------
1 | user = $user;
34 | $this->status = $status;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Events/User/UserUpdated.php:
--------------------------------------------------------------------------------
1 | user = $user;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Controllers/Backend/User/UserSessionController.php:
--------------------------------------------------------------------------------
1 | update(['to_be_logged_out' => true]);
21 |
22 | return redirect()->back()->withFlashSuccess(__('The user\'s session was successfully cleared.'));
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Controllers/Frontend/Auth/ConfirmPasswordController.php:
--------------------------------------------------------------------------------
1 | user()->disableTwoFactorAuth();
27 |
28 | return redirect()->route('frontend.user.account', ['#two-factor-authentication'])->withFlashSuccess(__('Two Factor Authentication Successfully Disabled'));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Controllers/Frontend/Auth/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 | updatePassword($request->user(), $request->only('old_password', 'password'), true);
35 |
36 | return redirect()->route('frontend.user.account')
37 | ->withFlashSuccess(__('Password successfully updated.'));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Controllers/Frontend/Auth/SocialController.php:
--------------------------------------------------------------------------------
1 | redirect();
21 | }
22 |
23 | /**
24 | * @param $provider
25 | * @param UserService $userService
26 | * @return \Illuminate\Http\RedirectResponse
27 | *
28 | * @throws \App\Exceptions\GeneralException
29 | */
30 | public function callback($provider, UserService $userService)
31 | {
32 | $user = $userService->registerProvider(Socialite::driver($provider)->user(), $provider);
33 |
34 | if (! $user->isActive()) {
35 | auth()->logout();
36 |
37 | return redirect()->route('frontend.auth.login')->withFlashDanger(__('Your account has been deactivated.'));
38 | }
39 |
40 | auth()->login($user);
41 |
42 | event(new UserLoggedIn($user));
43 |
44 | return redirect()->route(homeRoute());
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Controllers/Frontend/Auth/UpdatePasswordController.php:
--------------------------------------------------------------------------------
1 | userService = $userService;
26 | }
27 |
28 | /**
29 | * @param UpdatePasswordRequest $request
30 | * @return mixed
31 | *
32 | * @throws \Throwable
33 | */
34 | public function update(UpdatePasswordRequest $request)
35 | {
36 | $this->userService->updatePassword($request->user(), $request->validated());
37 |
38 | return redirect()->route('frontend.user.account', ['#password'])->withFlashSuccess(__('Password successfully updated.'));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Middleware/AdminCheck.php:
--------------------------------------------------------------------------------
1 | user() && $request->user()->isType(User::TYPE_ADMIN)) {
21 | return $next($request);
22 | }
23 |
24 | return redirect()->route('frontend.index')->withFlashDanger(__('You do not have access to do that.'));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Middleware/PasswordExpires.php:
--------------------------------------------------------------------------------
1 | user()->password_changed_at ?? $request->user()->created_at);
24 |
25 | if (now()->diffInDays($password_changed_at) >= config('boilerplate.access.user.password_expires_days')) {
26 | return redirect()
27 | ->route('frontend.auth.password.expired')
28 | ->withFlashWarning(__('Your password has expired. We require you to change your password every :days days for security purposes.', [
29 | 'days' => config('boilerplate.access.user.password_expires_days'),
30 | ]));
31 | }
32 | }
33 |
34 | return $next($request);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Middleware/SuperAdminCheck.php:
--------------------------------------------------------------------------------
1 | user() && $request->user()->hasAllAccess()) {
20 | return $next($request);
21 | }
22 |
23 | return redirect()->route('frontend.index')->withFlashDanger(__('You do not have access to do that.'));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Middleware/ToBeLoggedOut.php:
--------------------------------------------------------------------------------
1 | user() && $request->user()->to_be_logged_out) {
21 | // Make sure they can log back in next session
22 | $request->user()->update(['to_be_logged_out' => false]);
23 |
24 | // Kill the current session and force back to the login screen
25 | session()->flush();
26 | auth()->logout();
27 |
28 | return redirect()->route('frontend.auth.login');
29 | }
30 |
31 | return $next($request);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Middleware/TwoFactorAuthenticationStatus.php:
--------------------------------------------------------------------------------
1 | is('admin*') && ! config('boilerplate.access.user.admin_requires_2fa')) {
26 | return $next($request);
27 | }
28 |
29 | // Page requires 2fa, but user is not enabled or page does not require 2fa, but it is enabled
30 | if (
31 | ($status === 'enabled' && ! $request->user()->hasTwoFactorEnabled()) ||
32 | ($status === 'disabled' && $request->user()->hasTwoFactorEnabled())
33 | ) {
34 | return redirect()->route('frontend.auth.account.2fa.create')->withFlashDanger(__('Two-factor Authentication must be :status to view this page.', ['status' => $status]));
35 | }
36 |
37 | return $next($request);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Middleware/UserCheck.php:
--------------------------------------------------------------------------------
1 | user() && $request->user()->isType(User::TYPE_USER)) {
21 | return $next($request);
22 | }
23 |
24 | return redirect()->route('frontend.index')->withFlashDanger(__('You do not have access to do that.'));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Middleware/UserTypeCheck.php:
--------------------------------------------------------------------------------
1 | user()) {
21 | if (strpos($type, '|') !== false) {
22 | $types = explode('|', $type);
23 |
24 | foreach ($types as $t) {
25 | if ($request->user()->isType($t)) {
26 | return $next($request);
27 | }
28 | }
29 | } elseif ($request->user()->isType($type)) {
30 | return $next($request);
31 | }
32 | }
33 |
34 | return redirect()->route('frontend.index')->withFlashDanger(__('You do not have access to do that.'));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Requests/Backend/Role/DeleteRoleRequest.php:
--------------------------------------------------------------------------------
1 | role->isAdmin();
21 | }
22 |
23 | /**
24 | * Get the validation rules that apply to the request.
25 | *
26 | * @return array
27 | */
28 | public function rules()
29 | {
30 | return [
31 | //
32 | ];
33 | }
34 |
35 | /**
36 | * Handle a failed authorization attempt.
37 | *
38 | * @return void
39 | *
40 | * @throws \Illuminate\Auth\Access\AuthorizationException
41 | */
42 | protected function failedAuthorization()
43 | {
44 | throw new AuthorizationException(__('You can not delete the Administrator role.'));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Requests/Backend/Role/EditRoleRequest.php:
--------------------------------------------------------------------------------
1 | role->isAdmin();
21 | }
22 |
23 | /**
24 | * Get the validation rules that apply to the request.
25 | *
26 | * @return array
27 | */
28 | public function rules()
29 | {
30 | return [
31 | //
32 | ];
33 | }
34 |
35 | /**
36 | * Handle a failed authorization attempt.
37 | *
38 | * @return void
39 | *
40 | * @throws \Illuminate\Auth\Access\AuthorizationException
41 | */
42 | protected function failedAuthorization()
43 | {
44 | throw new AuthorizationException(__('You can not edit the Administrator role.'));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Requests/Backend/Role/StoreRoleRequest.php:
--------------------------------------------------------------------------------
1 | ['required', Rule::in([User::TYPE_ADMIN, User::TYPE_USER])],
33 | 'name' => ['required', 'max:100', Rule::unique('roles')],
34 | 'permissions' => ['sometimes', 'array'],
35 | 'permissions.*' => [Rule::exists('permissions', 'id')->where('type', $this->type)],
36 | ];
37 | }
38 |
39 | /**
40 | * @return array
41 | */
42 | public function messages()
43 | {
44 | return [
45 | 'permissions.*.exists' => __('One or more permissions were not found or are not allowed to be associated with this role type.'),
46 | ];
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Requests/Backend/User/ClearUserSessionRequest.php:
--------------------------------------------------------------------------------
1 | user->id !== $this->user()->id;
21 | }
22 |
23 | /**
24 | * Get the validation rules that apply to the request.
25 | *
26 | * @return array
27 | */
28 | public function rules()
29 | {
30 | return [
31 | //
32 | ];
33 | }
34 |
35 | /**
36 | * Handle a failed authorization attempt.
37 | *
38 | * @return void
39 | *
40 | * @throws \Illuminate\Auth\Access\AuthorizationException
41 | */
42 | protected function failedAuthorization()
43 | {
44 | throw new AuthorizationException(__('You can not clear your own session.'));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Requests/Backend/User/DeleteUserRequest.php:
--------------------------------------------------------------------------------
1 | user->isMasterAdmin();
21 | }
22 |
23 | /**
24 | * Get the validation rules that apply to the request.
25 | *
26 | * @return array
27 | */
28 | public function rules()
29 | {
30 | return [
31 | //
32 | ];
33 | }
34 |
35 | /**
36 | * Handle a failed authorization attempt.
37 | *
38 | * @return void
39 | *
40 | * @throws \Illuminate\Auth\Access\AuthorizationException
41 | */
42 | protected function failedAuthorization()
43 | {
44 | throw new AuthorizationException(__('You can not delete the master administrator.'));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Requests/Backend/User/EditUserPasswordRequest.php:
--------------------------------------------------------------------------------
1 | user->isMasterAdmin() && ! $this->user()->isMasterAdmin());
21 | }
22 |
23 | /**
24 | * Get the validation rules that apply to the request.
25 | *
26 | * @return array
27 | */
28 | public function rules()
29 | {
30 | return [
31 | //
32 | ];
33 | }
34 |
35 | /**
36 | * Handle a failed authorization attempt.
37 | *
38 | * @return void
39 | *
40 | * @throws \Illuminate\Auth\Access\AuthorizationException
41 | */
42 | protected function failedAuthorization()
43 | {
44 | throw new AuthorizationException(__('Only the administrator can change their password.'));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Requests/Backend/User/EditUserRequest.php:
--------------------------------------------------------------------------------
1 | user->isMasterAdmin() && ! $this->user()->isMasterAdmin());
21 | }
22 |
23 | /**
24 | * Get the validation rules that apply to the request.
25 | *
26 | * @return array
27 | */
28 | public function rules()
29 | {
30 | return [
31 | //
32 | ];
33 | }
34 |
35 | /**
36 | * Handle a failed authorization attempt.
37 | *
38 | * @return void
39 | *
40 | * @throws \Illuminate\Auth\Access\AuthorizationException
41 | */
42 | protected function failedAuthorization()
43 | {
44 | throw new AuthorizationException(__('Only the administrator can update this user.'));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Requests/Frontend/Auth/DisableTwoFactorAuthenticationRequest.php:
--------------------------------------------------------------------------------
1 | ['required', 'max:10', 'totp_code'],
31 | ];
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Http/Requests/Frontend/Auth/UpdatePasswordRequest.php:
--------------------------------------------------------------------------------
1 | ['required', 'max:100'],
33 | 'password' => array_merge(
34 | [
35 | 'max:100',
36 | new UnusedPassword($this->user()),
37 | ],
38 | PasswordRules::changePassword(
39 | $this->email,
40 | config('boilerplate.access.user.password_history') ? 'current_password' : null
41 | )
42 | ),
43 | ];
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Models/PasswordHistory.php:
--------------------------------------------------------------------------------
1 | isAdmin()) {
16 | return 'All';
17 | }
18 |
19 | if (! $this->permissions->count()) {
20 | return 'None';
21 | }
22 |
23 | return collect($this->getPermissionDescriptions())
24 | ->implode('
');
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Models/Traits/Method/RoleMethod.php:
--------------------------------------------------------------------------------
1 | name === config('boilerplate.access.role.admin');
18 | }
19 |
20 | /**
21 | * @return Collection
22 | */
23 | public function getPermissionDescriptions(): Collection
24 | {
25 | return $this->permissions->pluck('description');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Models/Traits/Relationship/PermissionRelationship.php:
--------------------------------------------------------------------------------
1 | belongsTo(__CLASS__, 'parent_id')->with('parent');
16 | }
17 |
18 | /**
19 | * @return mixed
20 | */
21 | public function children()
22 | {
23 | return $this->hasMany(__CLASS__, 'parent_id')->with('children');
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Models/Traits/Relationship/UserRelationship.php:
--------------------------------------------------------------------------------
1 | morphMany(PasswordHistory::class, 'model');
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Models/Traits/Scope/PermissionScope.php:
--------------------------------------------------------------------------------
1 | whereDoesntHave('parent')
17 | ->whereHas('children');
18 | }
19 |
20 | /**
21 | * @param $query
22 | * @return mixed
23 | */
24 | public function scopeIsParent($query)
25 | {
26 | return $query->whereHas('children');
27 | }
28 |
29 | /**
30 | * @param $query
31 | * @return mixed
32 | */
33 | public function scopeIsChild($query)
34 | {
35 | return $query->whereHas('parent');
36 | }
37 |
38 | /**
39 | * @param $query
40 | * @return mixed
41 | */
42 | public function scopeSingular($query)
43 | {
44 | return $query->whereNull('parent_id')
45 | ->whereDoesntHave('children');
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Models/Traits/Scope/RoleScope.php:
--------------------------------------------------------------------------------
1 | where(function ($query) use ($term) {
18 | $query->where('name', 'like', '%'.$term.'%')
19 | ->orWhereHas('permissions', function ($query) use ($term) {
20 | $query->where('description', 'like', '%'.$term.'%');
21 | });
22 | });
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Observers/UserObserver.php:
--------------------------------------------------------------------------------
1 | logPasswordHistory($user);
18 | }
19 |
20 | /**
21 | * @param User $user
22 | */
23 | public function updated(User $user): void
24 | {
25 | // Only log password history on update if the password actually changed
26 | if ($user->isDirty('password')) {
27 | $this->logPasswordHistory($user);
28 | }
29 | }
30 |
31 | /**
32 | * @param User $user
33 | */
34 | private function logPasswordHistory(User $user): void
35 | {
36 | if (config('boilerplate.access.user.password_history')) {
37 | $user->passwordHistories()->create([
38 | 'password' => $user->password, // Password already hashed & saved so just take from model
39 | ]);
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Domains/Auth/Services/PermissionService.php:
--------------------------------------------------------------------------------
1 | model = $permission;
21 | }
22 |
23 | /**
24 | * @return mixed
25 | */
26 | public function getCategorizedPermissions()
27 | {
28 | return $this->model::isMaster()
29 | ->with('children')
30 | ->get();
31 | }
32 |
33 | /**
34 | * @return mixed
35 | */
36 | public function getUncategorizedPermissions()
37 | {
38 | return $this->model::singular()
39 | ->orderBy('sort', 'asc')
40 | ->get();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Exceptions/GeneralException.php:
--------------------------------------------------------------------------------
1 | back()
49 | ->withInput()
50 | ->withFlashDanger($this->message);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Exceptions/ReportableException.php:
--------------------------------------------------------------------------------
1 | back()
49 | ->withInput()
50 | ->withFlashDanger($this->message);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Helpers/Global/GeneralHelper.php:
--------------------------------------------------------------------------------
1 | check()) {
41 | if (auth()->user()->isAdmin()) {
42 | return 'admin.dashboard';
43 | }
44 |
45 | if (auth()->user()->isUser()) {
46 | return 'frontend.user.dashboard';
47 | }
48 | }
49 |
50 | return 'frontend.index';
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Helpers/Global/HtmlHelper.php:
--------------------------------------------------------------------------------
1 | getLocale());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Helpers/Global/SystemHelper.php:
--------------------------------------------------------------------------------
1 | valid()) {
17 | if (! $it->isDot() && $it->isFile() && $it->isReadable() && $it->current()->getExtension() === 'php') {
18 | require $it->key();
19 | }
20 |
21 | $it->next();
22 | }
23 | } catch (Exception $e) {
24 | echo $e->getMessage();
25 | }
26 | }
27 | }
28 |
29 | if (! function_exists('includeRouteFiles')) {
30 |
31 | /**
32 | * @param $folder
33 | */
34 | function includeRouteFiles($folder)
35 | {
36 | includeFilesInFolder($folder);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Helpers/Global/TimezoneHelper.php:
--------------------------------------------------------------------------------
1 | updateProfile($request->user(), $request->validated());
21 |
22 | if (session()->has('resent')) {
23 | return redirect()->route('frontend.auth.verification.notice')->withFlashInfo(__('You must confirm your new e-mail address before you can go any further.'));
24 | }
25 |
26 | return redirect()->route('frontend.user.account', ['#information'])->withFlashSuccess(__('Profile successfully updated.'));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Http/Controllers/LocaleController.php:
--------------------------------------------------------------------------------
1 | setLocale($locale);
17 |
18 | session()->put('locale', $locale);
19 |
20 | return redirect()->back();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/Http/Livewire/Backend/RolesTable.php:
--------------------------------------------------------------------------------
1 | withCount('users')
22 | ->when($this->getFilter('search'), fn ($query, $term) => $query->search($term));
23 | }
24 |
25 | public function columns(): array
26 | {
27 | return [
28 | Column::make(__('Type'))
29 | ->sortable(),
30 | Column::make(__('Name'))
31 | ->sortable(),
32 | Column::make(__('Permissions')),
33 | Column::make(__('Number of Users'), 'users_count')
34 | ->sortable(),
35 | Column::make(__('Actions')),
36 | ];
37 | }
38 |
39 | public function rowView(): string
40 | {
41 | return 'backend.auth.role.includes.row';
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/Http/Livewire/Frontend/TwoFactorAuthentication.php:
--------------------------------------------------------------------------------
1 | validate([
25 | 'code' => 'required|min:6',
26 | ]);
27 |
28 | if ($request->user()->confirmTwoFactorAuth($this->code)) {
29 | $this->resetErrorBag();
30 |
31 | session()->flash('flash_success', __('Two Factor Authentication Successfully Enabled'));
32 |
33 | return redirect()->route('frontend.auth.account.2fa.show');
34 | }
35 |
36 | $this->addError('code', __('Your authorization code was invalid. Please try again.'));
37 |
38 | return false;
39 | }
40 |
41 | /**
42 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
43 | */
44 | public function render()
45 | {
46 | return view('components.frontend.two-factor-authentication');
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
21 | return route('frontend.auth.login');
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Http/Middleware/CheckForMaintenanceMode.php:
--------------------------------------------------------------------------------
1 | has('locale')) {
23 | setAllLocale(session()->get('locale'));
24 | }
25 |
26 | return $next($request);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
29 | return redirect(RouteServiceProvider::HOME);
30 | }
31 | }
32 |
33 | return $next($request);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | allSubdomainsOfApplicationUrl(),
21 | ];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | ['required', 'max:100'],
32 | 'email' => [Rule::requiredIf(function () {
33 | return config('boilerplate.access.user.change_email');
34 | }), 'max:255', 'email', Rule::unique('users')->ignore($this->user()->id)],
35 | ];
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/Models/Traits/Uuid.php:
--------------------------------------------------------------------------------
1 | where($this->getUuidName(), $uuid);
20 | }
21 |
22 | /**
23 | * @return string
24 | */
25 | public function getUuidName()
26 | {
27 | return property_exists($this, 'uuidName') ? $this->uuidName : 'uuid';
28 | }
29 |
30 | /**
31 | * Use Laravel bootable traits.
32 | */
33 | protected static function bootUuid()
34 | {
35 | static::creating(function ($model) {
36 | $model->{$model->getUuidName()} = PackageUuid::uuid4()->toString();
37 | });
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
20 | ];
21 |
22 | /**
23 | * Register any authentication / authorization services.
24 | *
25 | * @return void
26 | */
27 | public function boot()
28 | {
29 | $this->registerPolicies();
30 |
31 | // Implicitly grant "Admin" role all permissions
32 | // This works in the app by using gate-related functions like auth()->user->can() and @can()
33 | Gate::before(function ($user) {
34 | return $user->hasAllAccess() ? true : null;
35 | });
36 |
37 | // Learn when to use this instead: https://docs.spatie.be/laravel-permission/v3/basic-usage/super-admin/#gate-after
38 | // Gate::after(function ($user) {
39 | // return $user->hasAllAccess();
40 | // });
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | with('logged_in_user', auth()->user());
23 | });
24 |
25 | View::composer(['frontend.index', 'frontend.layouts.app'], function ($view) use ($announcementService) {
26 | $view->with('announcements', $announcementService->getForFrontend());
27 | });
28 |
29 | View::composer(['backend.layouts.app'], function ($view) use ($announcementService) {
30 | $view->with('announcements', $announcementService->getForBackend());
31 | });
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Providers/EventServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
23 | SendEmailVerificationNotification::class,
24 | ],
25 | ];
26 |
27 | /**
28 | * Class event subscribers.
29 | *
30 | * @var array
31 | */
32 | protected $subscribe = [
33 | RoleEventListener::class,
34 | UserEventListener::class,
35 | ];
36 |
37 | /**
38 | * Register any events for your application.
39 | *
40 | * @return void
41 | */
42 | public function boot()
43 | {
44 | parent::boot();
45 |
46 | //
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/Providers/HelperServiceProvider.php:
--------------------------------------------------------------------------------
1 | valid()) {
23 | if (
24 | ! $it->isDot() &&
25 | $it->isFile() &&
26 | $it->isReadable() &&
27 | $it->current()->getExtension() === 'php' &&
28 | strpos($it->current()->getFilename(), 'Helper')
29 | ) {
30 | require $it->key();
31 | }
32 |
33 | $it->next();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Providers/LocaleServiceProvider.php:
--------------------------------------------------------------------------------
1 | registerBladeExtensions();
21 | }
22 |
23 | /**
24 | * Register the locale blade extensions.
25 | */
26 | protected function registerBladeExtensions(): void
27 | {
28 | /*
29 | * The block of code inside this directive indicates
30 | * the chosen language requests RTL support.
31 | */
32 | Blade::if('langrtl', function () {
33 | return session()->has('lang-rtl');
34 | });
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Providers/ObserverServiceProvider.php:
--------------------------------------------------------------------------------
1 | ['api/*', 'sanctum/csrf-cookie'],
19 |
20 | 'allowed_methods' => ['*'],
21 |
22 | 'allowed_origins' => ['*'],
23 |
24 | 'allowed_origins_patterns' => [],
25 |
26 | 'allowed_headers' => ['*'],
27 |
28 | 'exposed_headers' => [],
29 |
30 | 'max_age' => 0,
31 |
32 | 'supports_credentials' => false,
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/config/livewire-tables.php:
--------------------------------------------------------------------------------
1 | 'bootstrap-4',
8 | ];
9 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/database/factories/RoleFactory.php:
--------------------------------------------------------------------------------
1 | $this->faker->randomElement([User::TYPE_ADMIN, User::TYPE_USER]),
30 | 'name' => $this->faker->word,
31 | ];
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/2019_08_19_000000_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
18 | $table->string('uuid')->unique();
19 | $table->text('connection');
20 | $table->text('queue');
21 | $table->longText('payload');
22 | $table->longText('exception');
23 | $table->timestamp('failed_at')->useCurrent();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('failed_jobs');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
18 | $table->morphs('tokenable');
19 | $table->string('name');
20 | $table->string('token', 64)->unique();
21 | $table->text('abilities')->nullable();
22 | $table->timestamp('last_used_at')->nullable();
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('personal_access_tokens');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/database/migrations/2020_05_25_021239_create_announcements_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->enum('area', ['frontend', 'backend'])->nullable();
19 | $table->enum('type', ['info', 'danger', 'warning', 'success'])->default('info');
20 | $table->text('message');
21 | $table->boolean('enabled')->default(true);
22 | $table->timestamp('starts_at')->nullable();
23 | $table->timestamp('ends_at')->nullable();
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('announcements');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/migrations/2020_05_29_020244_create_password_histories_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('model_type');
19 | $table->unsignedBigInteger('model_id');
20 | $table->string('password');
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::dropIfExists('password_histories');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/database/seeders/Auth/UserRoleSeeder.php:
--------------------------------------------------------------------------------
1 | disableForeignKeys();
22 |
23 | User::find(1)->assignRole(config('boilerplate.access.role.admin'));
24 |
25 | $this->enableForeignKeys();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/database/seeders/Auth/UserSeeder.php:
--------------------------------------------------------------------------------
1 | disableForeignKeys();
22 |
23 | // Add the master administrator, user id of 1
24 | User::create([
25 | 'type' => User::TYPE_ADMIN,
26 | 'name' => 'Super Admin',
27 | 'email' => 'admin@admin.com',
28 | 'password' => 'secret',
29 | 'email_verified_at' => now(),
30 | 'active' => true,
31 | ]);
32 |
33 | if (app()->environment(['local', 'testing'])) {
34 | User::create([
35 | 'type' => User::TYPE_USER,
36 | 'name' => 'Test User',
37 | 'email' => 'user@user.com',
38 | 'password' => 'secret',
39 | 'email_verified_at' => now(),
40 | 'active' => true,
41 | ]);
42 | }
43 |
44 | $this->enableForeignKeys();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/database/seeders/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | truncateMultiple([
24 | 'activity_log',
25 | 'failed_jobs',
26 | ]);
27 |
28 | $this->call(AuthSeeder::class);
29 | $this->call(AnnouncementSeeder::class);
30 |
31 | Model::reguard();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/database/seeders/Traits/TruncateTable.php:
--------------------------------------------------------------------------------
1 | truncate();
21 |
22 | case 'pgsql':
23 | return DB::statement('TRUNCATE TABLE '.$table.' RESTART IDENTITY CASCADE');
24 |
25 | case 'sqlite': case 'sqlsrv':
26 | return DB::statement('DELETE FROM '.$table);
27 | }
28 |
29 | return false;
30 | }
31 |
32 | /**
33 | * @param array $tables
34 | */
35 | protected function truncateMultiple(array $tables)
36 | {
37 | foreach ($tables as $table) {
38 | $this->truncate($table);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "mix",
6 | "watch": "mix watch",
7 | "watch-poll": "mix watch -- --watch-options-poll=1000",
8 | "hot": "mix watch --hot",
9 | "prod": "npm run production",
10 | "production": "mix --production"
11 | },
12 | "devDependencies": {
13 | "@coreui/coreui": "^3.0.0",
14 | "@coreui/icons": "^1.0.1",
15 | "@fortawesome/fontawesome-free": "^5.12.1",
16 | "@popperjs/core": "^2.5.1",
17 | "alpinejs": "^2.3.5",
18 | "axios": "^0.21.1",
19 | "bootstrap": "^4.5.0",
20 | "cross-env": "^7.0",
21 | "jquery": "^3.5.1",
22 | "laravel-mix": "^6.0.6",
23 | "lodash": "^4.17.19",
24 | "perfect-scrollbar": "^1.5.0",
25 | "popper.js": "^1.16.1",
26 | "postcss": "^8.1",
27 | "resolve-url-loader": "^3.1.0",
28 | "sass": "^1.20.1",
29 | "sass-loader": "^8.0.0",
30 | "sweetalert2": "^9.8.2",
31 | "vue": "^2.5.17",
32 | "vue-loader": "^15.9.5",
33 | "vue-template-compiler": "^2.6.10"
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |