├── .dockerignore ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .styleci.yml ├── .vscode └── launch.json ├── VERSION ├── app ├── Core │ ├── Console │ │ ├── Kernel.php │ │ └── Traits │ │ │ └── ExposeBehaviors.php │ ├── Exceptions │ │ └── Handler.php │ ├── Http │ │ ├── Kernel.php │ │ └── Middleware │ │ │ ├── Authenticate.php │ │ │ ├── CheckForMaintenanceMode.php │ │ │ ├── EncryptCookies.php │ │ │ ├── RedirectIfAuthenticated.php │ │ │ ├── TrimStrings.php │ │ │ ├── TrustProxies.php │ │ │ └── VerifyCsrfToken.php │ └── Providers │ │ ├── AppServiceProvider.php │ │ └── RouteServiceProvider.php ├── Domains │ ├── Companies │ │ ├── Console │ │ │ └── Closures │ │ │ │ └── ClosureCommands.php │ │ ├── Database │ │ │ ├── Factories │ │ │ │ └── CompanyFactory.php │ │ │ ├── Migrations │ │ │ │ └── 2019_07_01_203524_create_companies_table.php │ │ │ └── Seeders │ │ │ │ └── DatabaseSeeder.php │ │ ├── Http │ │ │ ├── Controllers │ │ │ │ ├── Api │ │ │ │ │ └── CompanyController.php │ │ │ │ └── CompanyController.php │ │ │ ├── Requests │ │ │ │ └── CompanyFormRequest.php │ │ │ ├── Resources │ │ │ │ └── CompanyResource.php │ │ │ └── Routes │ │ │ │ ├── Api.php │ │ │ │ └── Web.php │ │ ├── Models │ │ │ ├── Company.php │ │ │ └── Traits │ │ │ │ ├── CompanyBoot.php │ │ │ │ └── CompanyRelationship.php │ │ ├── Policies │ │ │ └── CompanyPolicy.php │ │ ├── Providers │ │ │ ├── AuthServiceProvider.php │ │ │ ├── CompanyServiceProvider.php │ │ │ └── RouteServiceProvider.php │ │ ├── Repositories │ │ │ ├── CompanyRepository.php │ │ │ ├── Criteria │ │ │ │ └── JoinUserCriteria.php │ │ │ └── Filterable │ │ │ │ └── CompanyBuilderFilter.php │ │ ├── Resources │ │ │ └── Views │ │ │ │ ├── _filter.blade.php │ │ │ │ ├── _form.blade.php │ │ │ │ ├── _header.blade.php │ │ │ │ ├── create.blade.php │ │ │ │ ├── edit.blade.php │ │ │ │ └── index.blade.php │ │ └── Services │ │ │ └── CompanyService.php │ ├── DomainServiceProvider.php │ ├── Suppliers │ │ ├── Console │ │ │ └── Closures │ │ │ │ └── ClosureCommands.php │ │ ├── Database │ │ │ ├── Factories │ │ │ │ └── SupplierFactory.php │ │ │ ├── Migrations │ │ │ │ └── 2019_07_01_240880_create_suppliers_table.php │ │ │ └── Seeders │ │ │ │ ├── DatabaseSeeder.php │ │ │ │ └── SuppliersTableSeeder.php │ │ ├── Http │ │ │ ├── Controllers │ │ │ │ ├── Api │ │ │ │ │ └── SupplierController.php │ │ │ │ ├── SupplierController.php │ │ │ │ └── SupplierGuestController.php │ │ │ ├── Requests │ │ │ │ └── SupplierFormRequest.php │ │ │ ├── Resources │ │ │ │ └── SupplierResource.php │ │ │ └── Routes │ │ │ │ ├── Api.php │ │ │ │ ├── Web.php │ │ │ │ └── WebGuest.php │ │ ├── Models │ │ │ ├── Supplier.php │ │ │ └── Traits │ │ │ │ ├── Boots │ │ │ │ └── QueryFilterSuppliersByUsers.php │ │ │ │ ├── Scopes │ │ │ │ └── SuppliersOnlyCompanyScope.php │ │ │ │ ├── SupplierFunction.php │ │ │ │ └── SupplierRelationship.php │ │ ├── Notifications │ │ │ └── LinkToSupplierActivation.php │ │ ├── Pipelines │ │ │ └── SanitizeMonthlyPayment.php │ │ ├── Policies │ │ │ └── SupplierPolicy.php │ │ ├── Providers │ │ │ ├── AuthServiceProvider.php │ │ │ ├── RouteServiceProvider.php │ │ │ └── SupplierServiceProvider.php │ │ ├── Repositories │ │ │ ├── Filterable │ │ │ │ └── SupplierBuilderFilter.php │ │ │ └── SupplierRepository.php │ │ ├── Resources │ │ │ └── Views │ │ │ │ ├── _filter.blade.php │ │ │ │ ├── _form.blade.php │ │ │ │ ├── _header.blade.php │ │ │ │ ├── create.blade.php │ │ │ │ ├── edit.blade.php │ │ │ │ └── index.blade.php │ │ └── Services │ │ │ └── SupplierService.php │ └── Users │ │ ├── Console │ │ ├── Closures │ │ │ └── ClosureCommands.php │ │ └── Commands │ │ │ └── UserCommand.php │ │ ├── Database │ │ ├── Factories │ │ │ ├── UserAdminRoleFactory.php │ │ │ ├── UserCompanyRoleFactory.php │ │ │ ├── UserFactory.php │ │ │ └── UserSuperAdminRoleFactory.php │ │ ├── Migrations │ │ │ ├── 2019_07_01_049635_create_roles_table.php │ │ │ ├── 2019_07_01_113233_create_logins_table.php │ │ │ ├── 2019_07_01_117085_create_users_table.php │ │ │ └── 2019_08_23_101100_add_session_id_to_users_table.php │ │ └── Seeders │ │ │ ├── AdminsUsersTableSeeder.php │ │ │ ├── CompaniesUsersTableSeeder.php │ │ │ ├── DatabaseSeeder.php │ │ │ ├── RolesTableSeeder.php │ │ │ └── SuperAdminsUsersTableSeeder.php │ │ ├── Http │ │ ├── Controllers │ │ │ ├── Api │ │ │ │ └── UserController.php │ │ │ └── UserController.php │ │ ├── Requests │ │ │ └── UserFormRequest.php │ │ └── Routes │ │ │ ├── Api.php │ │ │ └── Web.php │ │ ├── Models │ │ ├── Admin.php │ │ ├── Company.php │ │ ├── Role.php │ │ ├── SuperAdmin.php │ │ ├── Traits │ │ │ ├── RoleRelationship.php │ │ │ ├── UserAccessor.php │ │ │ ├── UserBoot.php │ │ │ ├── UserFunction.php │ │ │ ├── UserRelationship.php │ │ │ └── UserScope.php │ │ └── User.php │ │ ├── Observers │ │ └── UserObserver.php │ │ ├── Policies │ │ └── UserPolicy.php │ │ ├── Providers │ │ ├── AuthServiceProvider.php │ │ ├── BindServiceProvider.php │ │ ├── EventServiceProvider.php │ │ ├── RouteServiceProvider.php │ │ └── UserServiceProvider.php │ │ ├── Repositories │ │ ├── Criteria │ │ │ ├── JoinRoleCriteria.php │ │ │ └── UserPermissionCriteria.php │ │ ├── Filterable │ │ │ └── UserBuilderFilter.php │ │ ├── Filters │ │ │ └── NameOrEmail.php │ │ ├── RoleRepository.php │ │ └── UserRepository.php │ │ ├── Resources │ │ ├── Lang │ │ │ ├── en │ │ │ │ └── messages.php │ │ │ └── pt_BR │ │ │ │ └── messages.php │ │ └── Views │ │ │ ├── _filter.blade.php │ │ │ ├── _form.blade.php │ │ │ ├── _header.blade.php │ │ │ ├── create.blade.php │ │ │ ├── edit.blade.php │ │ │ └── index.blade.php │ │ └── Services │ │ └── UserService.php ├── Support │ ├── Console │ │ └── Routing │ │ │ └── RouteFile.php │ ├── Database │ │ ├── Console │ │ │ ├── ArtisanServiceProvider.php │ │ │ ├── Factories │ │ │ │ ├── FactoryMakeCommand.php │ │ │ │ └── stubs │ │ │ │ │ └── factory.stub │ │ │ ├── Migrations │ │ │ │ ├── Contracts │ │ │ │ │ └── MigrationConstants.php │ │ │ │ ├── MigrateCommand.php │ │ │ │ ├── MigrateMakeCommand.php │ │ │ │ ├── ResetCommand.php │ │ │ │ ├── RollbackCommand.php │ │ │ │ ├── StatusCommand.php │ │ │ │ └── Traits │ │ │ │ │ └── MigrationPathsTrait.php │ │ │ ├── Seeds │ │ │ │ ├── SeedCommand.php │ │ │ │ ├── SeederMakeCommand.php │ │ │ │ └── stubs │ │ │ │ │ └── seeder.stub │ │ │ └── Traits │ │ │ │ ├── DefaultToGeneratorCommand.php │ │ │ │ ├── DomainArgument.php │ │ │ │ └── DomainComponentNamespace.php │ │ ├── ConsoleSupportServiceProvider.php │ │ └── Eloquent │ │ │ └── ModelFactory.php │ ├── Domain │ │ └── ServiceProvider.php │ ├── Exceptions │ │ ├── BaseException.php │ │ └── HttpException │ │ │ ├── BadRequestException.php │ │ │ ├── ConflictException.php │ │ │ ├── ForbiddenException.php │ │ │ ├── InternalServerErrorException.php │ │ │ ├── NotFoundException.php │ │ │ ├── RequestTimeoutException.php │ │ │ ├── RequestUriTooLongException.php │ │ │ ├── UnauthorizedException.php │ │ │ └── UnprocessableEntityException.php │ ├── Helpers │ │ └── ApplicationHelper.php │ ├── Http │ │ └── Controller.php │ ├── Localization │ │ └── LocalizationServiceProvider.php │ ├── Models │ │ ├── BaseCollection.php │ │ ├── BaseEloquentBuilder.php │ │ └── BaseModel.php │ ├── Queue │ │ ├── HorizonApplicationServiceProvider.php │ │ └── HorizonServiceProvider.php │ ├── Repository │ │ ├── Eloquent │ │ │ ├── BaseRepository.php │ │ │ ├── Contracts │ │ │ │ ├── CriterionInterface.php │ │ │ │ └── RepositoryInterface.php │ │ │ ├── Criteria │ │ │ │ └── FindWhere.php │ │ │ ├── Filterable │ │ │ │ ├── Clauses │ │ │ │ │ ├── OrWhereClause.php │ │ │ │ │ ├── OrWhereLikeClause.php │ │ │ │ │ ├── WhereClause.php │ │ │ │ │ └── WhereLikeClause.php │ │ │ │ ├── Constants │ │ │ │ │ ├── GroupBy.php │ │ │ │ │ ├── Limit.php │ │ │ │ │ ├── OrderBy.php │ │ │ │ │ ├── Page.php │ │ │ │ │ └── SortBy.php │ │ │ │ ├── Contracts │ │ │ │ │ ├── ClausesInterface.php │ │ │ │ │ └── FiltersInterface.php │ │ │ │ └── QueryBuilderFilter.php │ │ │ ├── Operations │ │ │ │ ├── RepositoryCreate.php │ │ │ │ ├── RepositoryDelete.php │ │ │ │ ├── RepositoryRead.php │ │ │ │ └── RepositoryUpdate.php │ │ │ └── Traits │ │ │ │ ├── CacheableRepository.php │ │ │ │ └── HandleCriteria.php │ │ └── Exceptions │ │ │ └── RepositoryException.php │ ├── Service │ │ ├── BaseService.php │ │ └── Operations │ │ │ ├── ServiceCreate.php │ │ │ ├── ServiceDelete.php │ │ │ ├── ServiceRead.php │ │ │ └── ServiceUpdate.php │ ├── Specifications │ │ ├── AbstractPermissionSpecification.php │ │ ├── AbstractRoleSpecification.php │ │ ├── AndSpecification.php │ │ ├── Contracts │ │ │ └── Specification.php │ │ ├── NotSpecification.php │ │ └── OrSpecification.php │ ├── SupportServiceProvider.php │ ├── Validator │ │ └── FormRequestValidator.php │ └── View │ │ ├── Building │ │ ├── BladeExtensionsServiceProvider.php │ │ ├── FormServiceProvider.php │ │ └── LayoutServiceProvider.php │ │ ├── Composers │ │ └── FormValidationClassComposer.php │ │ └── ViewServiceProvider.php └── Units │ ├── Auth │ ├── Http │ │ ├── Controllers │ │ │ ├── Api │ │ │ │ ├── AuthController.php │ │ │ │ ├── Controller.php │ │ │ │ ├── ForgotPasswordController.php │ │ │ │ ├── MeController.php │ │ │ │ ├── RegisterController.php │ │ │ │ ├── ResetPasswordController.php │ │ │ │ └── Traits │ │ │ │ │ ├── Respond.php │ │ │ │ │ └── Token.php │ │ │ └── Web │ │ │ │ ├── Controller.php │ │ │ │ ├── ForgotPasswordController.php │ │ │ │ ├── LoginController.php │ │ │ │ ├── RegisterController.php │ │ │ │ ├── ResetPasswordController.php │ │ │ │ └── VerificationController.php │ │ ├── Middleware │ │ │ ├── ApiAuthenticate.php │ │ │ └── CheckRole.php │ │ ├── Resources │ │ │ └── UserResource.php │ │ └── Routes │ │ │ ├── Api.php │ │ │ └── Web.php │ ├── Listeners │ │ ├── SendEmailSuccessfullyVerifiedNotification.php │ │ ├── SendPasswordSuccessfullyResetNotification.php │ │ └── SendVerifyEmailNotification.php │ ├── Login.php │ ├── Notifications │ │ ├── EmailSuccessfullyVerified.php │ │ ├── LinkToResetPassword.php │ │ ├── LinkToVerifyEmail.php │ │ ├── PasswordSuccessfullyReset.php │ │ ├── ResetPasswordNotificationToMail.php │ │ └── VerifyEmailNotificationToMail.php │ ├── Providers │ │ ├── AuthServiceProvider.php │ │ ├── EventServiceProvider.php │ │ ├── RouteServiceProvider.php │ │ └── UnitServiceProvider.php │ ├── Resources │ │ └── Views │ │ │ ├── login.blade.php │ │ │ ├── passwords │ │ │ ├── email.blade.php │ │ │ └── reset.blade.php │ │ │ ├── register.blade.php │ │ │ └── verify.blade.php │ ├── Services │ │ ├── OneSessionPerUser.php │ │ ├── StoreUserAndCompany.php │ │ └── UpdateUserLastLogin.php │ └── User.php │ └── Dashboard │ ├── Http │ ├── Controllers │ │ └── Web │ │ │ └── DashboardController.php │ └── Routes │ │ └── Web.php │ ├── Providers │ ├── RouteServiceProvider.php │ └── UnitServiceProvider.php │ └── Resources │ └── Views │ └── index.blade.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── filesystems.php ├── flare.php ├── hashing.php ├── horizon.php ├── ignition.php ├── jwt.php ├── logging.php ├── mail.php ├── queue.php ├── services.php ├── session.php ├── tinker.php ├── trustedproxy.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_06_21_011028_create_failed_jobs_table.php │ ├── 2019_06_21_011208_create_jobs_table.php │ ├── 2019_06_21_011231_create_sessions_table.php │ ├── 2019_06_21_011249_create_notifications_table.php │ └── 2019_06_21_011302_create_cache_table.php └── seeds │ └── DatabaseSeeder.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── index.php ├── robots.txt └── web.config ├── readme.md ├── resources ├── assets │ ├── css │ │ ├── base.css │ │ ├── bootstrap.css │ │ └── custom.css │ ├── images │ │ ├── avatar.png │ │ ├── bitbucket.png │ │ ├── dribbble.png │ │ ├── dropbox.png │ │ ├── github.png │ │ ├── logo-fav.png │ │ ├── logo-symbol.png │ │ ├── logo-white-xx.png │ │ ├── logo-white.png │ │ ├── logo-xx.png │ │ ├── logo.png │ │ ├── mail_chimp.png │ │ └── slack.png │ ├── js │ │ ├── app.js │ │ └── bootstrap.js │ ├── libs │ │ ├── amaranjs │ │ │ ├── css │ │ │ │ └── amaran.min.css │ │ │ └── js │ │ │ │ └── jquery.amaran.min.js │ │ └── messenger │ │ │ ├── css │ │ │ ├── messenger-theme-air.min.css │ │ │ ├── messenger-theme-flat.min.css │ │ │ ├── messenger-theme-future.min.css │ │ │ ├── messenger-theme-ice.min.css │ │ │ └── messenger.min.css │ │ │ └── js │ │ │ ├── messenger-theme-flat.min.js │ │ │ ├── messenger-theme-future.min.js │ │ │ └── messenger.min.js │ └── sass │ │ ├── abstracts │ │ ├── _functions.scss │ │ ├── _mixins.scss │ │ ├── _placeholders.scss │ │ └── _variables.scss │ │ ├── app.scss │ │ ├── components │ │ ├── _accordions.scss │ │ ├── _alerts.scss │ │ ├── _all.scss │ │ ├── _badges.scss │ │ ├── _breadcrumbs.scss │ │ ├── _buttons.scss │ │ ├── _cards.scss │ │ ├── _dropdowns.scss │ │ ├── _forms.scss │ │ ├── _modal.scss │ │ ├── _pagination.scss │ │ ├── _popovers.scss │ │ ├── _tables.scss │ │ ├── _tabs.scss │ │ └── _typography.scss │ │ └── vendors │ │ ├── bootstrap.scss │ │ ├── fontawesome.scss │ │ └── material-icons.scss ├── lang │ ├── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php │ └── pt-BR │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── components │ ├── filters.blade.php │ └── form │ │ ├── _common.blade.php │ │ ├── buttons.blade.php │ │ ├── email.blade.php │ │ ├── file.blade.php │ │ ├── group.blade.php │ │ ├── number.blade.php │ │ ├── password.blade.php │ │ ├── select.blade.php │ │ ├── text.blade.php │ │ └── textarea.blade.php │ ├── errors │ ├── 401.blade.php │ ├── 403.blade.php │ ├── 404.blade.php │ ├── 419.blade.php │ ├── 429.blade.php │ ├── 500.blade.php │ ├── 503.blade.php │ ├── illustrated-layout.blade.php │ ├── layout.blade.php │ └── minimal.blade.php │ ├── layouts │ ├── master.blade.php │ └── partials │ │ ├── footer.blade.php │ │ ├── head.blade.php │ │ ├── left.blade.php │ │ ├── navigation.blade.php │ │ ├── notifications.blade.php │ │ └── scripts.blade.php │ └── pages │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── nginx │ └── .gitignore ├── tests ├── Bootstrap.php ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── webpack.mix.js /.dockerignore: -------------------------------------------------------------------------------- 1 | /.dev 2 | /.idea 3 | /examples 4 | /.vscode 5 | .git 6 | .gitignore 7 | .history 8 | .vscode 9 | .editorconfig 10 | LICENSE 11 | README.md 12 | CHANGELOG.md 13 | */*/.DS_Store* 14 | **/.DS_Store* 15 | 16 | .dockerignore 17 | Dockerfile* 18 | docker-compose* 19 | docker 20 | !docker/app/ssh 21 | !docker/mysql/ssl 22 | !docker/mongodb/ssl 23 | !docker/queue/config 24 | !docker/queue/docker-entrypoint.sh 25 | !docker/scheduler/cron-jobs 26 | !docker/scheduler/docker-entrypoint.sh 27 | !docker/app/docker-entrypoint.sh 28 | !docker/app/config 29 | !docker/nginx/config 30 | 31 | phpunit.xml 32 | Jenkinsfile 33 | vendor 34 | node_modules 35 | coverage 36 | bootstrap/cache/* 37 | storage/app/public/* 38 | storage/framework/cache/* 39 | storage/framework/sessions/* 40 | storage/framework/testing/* 41 | storage/framework/views/* 42 | storage/logs/* 43 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=App 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_LOCALE=pt-BR 6 | APP_FAKER_LOCALE=pt_BR 7 | APP_TIMEZONE=America/Fortaleza 8 | APP_URL=https://appxyz.dev 9 | 10 | JWT_SECRET= 11 | JWT_TTL=20160 12 | JWT_REFRESH_TTL=20160 # Em minutos (2 Semanas) 13 | 14 | LOG_CHANNEL=stack 15 | 16 | DB_CONNECTION=mysql 17 | DB_HOST=database 18 | DB_PORT=3306 19 | DB_DATABASE=app 20 | DB_USERNAME=app 21 | DB_PASSWORD="TxdITs=CgN9e7+p" 22 | 23 | BROADCAST_DRIVER=redis 24 | CACHE_DRIVER=redis 25 | QUEUE_CONNECTION=redis 26 | 27 | SESSION_DRIVER=file 28 | SESSION_DOMAIN=appxyz.dev 29 | SESSION_LIFETIME=120 30 | SESSION_SECURE_COOKIE=true 31 | 32 | REDIS_HOST=redis 33 | REDIS_CLIENT=phpredis 34 | REDIS_PASSWORD="HQD3{9S-u(qnxK@" 35 | REDIS_PORT=6379 36 | REDIS_QUEUE=queue_default 37 | 38 | MAIL_DRIVER=smtp 39 | MAIL_HOST=smtp.mailtrap.io 40 | MAIL_PORT=2525 41 | MAIL_USERNAME=null 42 | MAIL_PASSWORD=null 43 | MAIL_FROM_ADDRESS=no-reply@appxyz.dev 44 | MAIL_FROM_NAME= 45 | MAIL_ENCRYPTION=null 46 | 47 | AWS_ACCESS_KEY_ID= 48 | AWS_SECRET_ACCESS_KEY= 49 | AWS_DEFAULT_REGION=us-east-1 50 | AWS_BUCKET= 51 | 52 | PUSHER_APP_ID= 53 | PUSHER_APP_KEY= 54 | PUSHER_APP_SECRET= 55 | PUSHER_APP_CLUSTER=mt1 56 | 57 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 58 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 59 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /docker 2 | /node_modules 3 | /public/hot 4 | /public/css 5 | /public/js 6 | /public/images 7 | /public/fonts 8 | /public/mix-manifest.json 9 | /public/storage 10 | /storage/*.key 11 | /database/docker/mongodb 12 | /database/docker/mysql 13 | /vendor 14 | .env 15 | .phpunit.result.cache 16 | Homestead.json 17 | Homestead.yaml 18 | npm-debug.log 19 | yarn-error.log 20 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | enabled: 4 | - alpha_ordered_imports 5 | disabled: 6 | - length_ordered_imports 7 | - unused_use 8 | finder: 9 | not-name: 10 | - index.php 11 | - server.php 12 | js: 13 | finder: 14 | not-name: 15 | - webpack.mix.js 16 | css: true 17 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Listen for XDebug", 9 | "type": "php", 10 | "request": "launch", 11 | "port": 9001, 12 | "log": true, 13 | "pathMappings": { 14 | "/var/www/appxyz.dev": "${workspaceFolder}" 15 | }, 16 | "xdebugSettings": { 17 | "show_hidden": 1, 18 | "max_children": 100, 19 | "max_depth": 5 20 | } 21 | }, 22 | { 23 | "name": "Launch currently open script", 24 | "type": "php", 25 | "request": "launch", 26 | "program": "${file}", 27 | "cwd": "${fileDirname}", 28 | "port": 9001 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.0.0 -------------------------------------------------------------------------------- /app/Core/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 30 | // ->hourly(); 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/Core/Console/Traits/ExposeBehaviors.php: -------------------------------------------------------------------------------- 1 | load($paths); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Core/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('auth.show-form-login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Core/Http/Middleware/CheckForMaintenanceMode.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 25 | } 26 | 27 | /** 28 | * Handle an incoming request. 29 | * 30 | * @param \Illuminate\Http\Request $request 31 | * @param \Closure $next 32 | * @param string|null $guard 33 | * @return mixed 34 | */ 35 | public function handle($request, Closure $next, $guard = null) 36 | { 37 | if (Auth::guard($guard)->check()) { 38 | 39 | if ($this->isGuardApi($guard)) { 40 | if (! empty(optional($this->auth->setRequest($request)->getToken())->get())) { 41 | throw new UnauthorizedHttpException('auth.api', trans('Action can not be performed!')); 42 | } 43 | } 44 | 45 | return redirect()->route('dashboard.index')->with('error', 'Recurso pode ser acessado somente por visitantes!'); 46 | } 47 | 48 | return $next($request); 49 | } 50 | 51 | private function isGuardApi($guard = null): bool 52 | { 53 | return ! empty($guard) && $guard === 'api'; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/Core/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 31 | 32 | $this->mapWebRoutes(); 33 | 34 | // 35 | } 36 | 37 | /** 38 | * Define the "web" routes for the application. 39 | * 40 | * These routes all receive session state, CSRF protection, etc. 41 | * 42 | * @return void 43 | */ 44 | protected function mapWebRoutes() 45 | { 46 | Route::middleware('web') 47 | ->group(base_path('routes/web.php')); 48 | } 49 | 50 | /** 51 | * Define the "api" routes for the application. 52 | * 53 | * These routes are typically stateless. 54 | * 55 | * @return void 56 | */ 57 | protected function mapApiRoutes() 58 | { 59 | Route::prefix('api') 60 | ->middleware('api') 61 | ->group(base_path('routes/api.php')); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/Domains/Companies/Console/Closures/ClosureCommands.php: -------------------------------------------------------------------------------- 1 | artisan->command('build {project}', function ($project) { 23 | // $this->info("Building {$project}!"); 24 | // }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Domains/Companies/Database/Factories/CompanyFactory.php: -------------------------------------------------------------------------------- 1 | faker->addProvider(new \Faker\Provider\pt_BR\Company($this->faker)); 15 | } 16 | 17 | protected function fields(): array 18 | { 19 | return [ 20 | 'cnpj' => $this->faker->cnpj, 21 | 'social_name' => $this->faker->company, 22 | 'fantasy_name' => $this->faker->sentence($this->faker->numberBetween(3, 5)), 23 | 'phone' => $this->faker->phoneNumber, 24 | 'address' => $this->faker->address, 25 | 'postal_code' => $this->faker->postcode, 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Domains/Companies/Database/Migrations/2019_07_01_203524_create_companies_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | 19 | $table->unsignedBigInteger('user_id'); 20 | 21 | $table->string('cnpj', 20)->unique(); 22 | $table->string('social_name')->index(); 23 | $table->string('fantasy_name')->nullable(); 24 | $table->string('phone', 15)->nullable(); 25 | $table->string('address')->nullable(); 26 | $table->string('postal_code', 10)->nullable(); 27 | 28 | $table->timestamps(); 29 | 30 | $table->foreign('user_id')->references('id')->on('users'); 31 | }); 32 | } 33 | 34 | /** 35 | * Reverse the migrations. 36 | * 37 | * @return void 38 | */ 39 | public function down() 40 | { 41 | Schema::dropIfExists('companies'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Domains/Companies/Database/Seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | router->namespace('Api')->group(function ($router) { 17 | 18 | $this->router->name('companies.')->prefix('companies')->group(function ($router) { 19 | // Other routes 20 | }); 21 | 22 | // {do} is short for domain 23 | Route::model('docompany', Company::class); 24 | Route::apiResource('companies', CompanyController::class)->parameters([ 25 | 'companies' => 'docompany' 26 | ]); 27 | }); 28 | -------------------------------------------------------------------------------- /app/Domains/Companies/Http/Routes/Web.php: -------------------------------------------------------------------------------- 1 | router->name('companies.')->prefix('companies')->group(function () { 17 | // Other routes 18 | }); 19 | 20 | // @see https://laravel.com/docs/controllers#resource-controllers 21 | $this->router->group([], function ($router) { 22 | $router->model('docompany', Company::class); 23 | $router->resource('companies', CompanyController::class)->parameters([ 24 | 'companies' => 'docompany' 25 | ]); 26 | }); 27 | -------------------------------------------------------------------------------- /app/Domains/Companies/Models/Company.php: -------------------------------------------------------------------------------- 1 | 'integer', 38 | ]; 39 | } 40 | -------------------------------------------------------------------------------- /app/Domains/Companies/Models/Traits/CompanyBoot.php: -------------------------------------------------------------------------------- 1 | load('suppliers'); 23 | 24 | $company->suppliers->each(function($supplier, $key) { 25 | $supplier->delete(); 26 | }); 27 | 28 | // if ($company->user()->exists()) { 29 | // $company->user()->delete(); 30 | // } 31 | } 32 | 33 | return true; 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Domains/Companies/Models/Traits/CompanyRelationship.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class, 'user_id'); 18 | } 19 | 20 | /** 21 | * Has-Many relations with Supplier. 22 | * 23 | * @return \Illuminate\Database\Eloquent\Relations\HasMany 24 | */ 25 | public function suppliers() 26 | { 27 | return $this->hasMany(Supplier::class, 'company_id'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Domains/Companies/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | CompanyPolicy::class, 18 | ]; 19 | 20 | /** 21 | * Register any authentication / authorization services. 22 | * 23 | * @return void 24 | */ 25 | public function boot() 26 | { 27 | $this->registerPolicies(); 28 | 29 | // 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Domains/Companies/Providers/CompanyServiceProvider.php: -------------------------------------------------------------------------------- 1 | entity->with('suppliers')->findOrFail($companyKey); 42 | 43 | $amount = 0; 44 | 45 | $company->suppliers->each(function($supplier, $key) use (&$amount) { 46 | $amount += $supplier->getOriginal('monthly_payment'); 47 | }); 48 | 49 | return $amount; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Domains/Companies/Repositories/Criteria/JoinUserCriteria.php: -------------------------------------------------------------------------------- 1 | selectRaw( 23 | <<join('users', 'companies.user_id', '=', 'users.id') 30 | ->with('user'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Domains/Companies/Resources/Views/_filter.blade.php: -------------------------------------------------------------------------------- 1 | 2 | {!! Form::open(['method' => 'GET']) !!} 3 | @filters 4 | 5 | 6 | {!! Form::text('user_name_or_email', input('user_name_or_email'), ['autofocus', 'class' => 'form-control', 'placeholder' => 'Nome ou E-mail']) !!} 7 | 8 | 9 | {!! Form::text('cnpj', input('cnpj'), ['class' => 'form-control', 'placeholder' => 'CNPJ']) !!} 10 | 11 | 12 | {!! Form::text('social_or_fantasy', input('social_or_fantasy'), ['class' => 'form-control', 'placeholder' => 'Razão ou Fantasia']) !!} 13 | 14 | 15 | 16 | 17 | 18 | 19 | {!! Form::button('', ['type' => 'submit', 'class' => 'btn btn-space btn-secondary btn-lg']) !!} 20 | 21 | {!! Form::close() !!} 22 | 23 | -------------------------------------------------------------------------------- /app/Domains/Companies/Resources/Views/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts::master') 2 | 3 | @section('pageTitle') 4 | @parent - Nova Empresa 5 | @stop 6 | 7 | @section('content') 8 |
9 |

Gerenciamento de Empresas

10 | 17 |
18 | 19 |
20 | @includeIf('companies::_form') 21 |
22 | @stop 23 | -------------------------------------------------------------------------------- /app/Domains/Companies/Resources/Views/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts::master') 2 | 3 | @section('pageTitle') 4 | @parent - Editar Empresa 5 | @stop 6 | 7 | @section('content') 8 |
9 |

Gerenciamento de Empresas

10 | 17 |
18 | 19 |
20 | @includeIf('companies::_form') 21 |
22 | @stop 23 | -------------------------------------------------------------------------------- /app/Domains/DomainServiceProvider.php: -------------------------------------------------------------------------------- 1 | artisan->command('build {project}', function ($project) { 23 | // $this->info("Building {$project}!"); 24 | // }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Database/Factories/SupplierFactory.php: -------------------------------------------------------------------------------- 1 | $isActivated = $this->faker->randomElement([false, true]), 16 | 'activated_at' => ($isActivated === TRUE) ? now() : null, 17 | 'name' => $this->faker->name, 18 | 'email' => $this->faker->unique()->safeEmail, 19 | 'monthly_payment' => $this->faker->randomFloat(2, 5000, 10000), 20 | ]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Database/Migrations/2019_07_01_240880_create_suppliers_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | 19 | $table->unsignedBigInteger('user_id'); 20 | $table->unsignedBigInteger('company_id'); 21 | 22 | $table->string('name')->index(); 23 | $table->string('email')->unique(); 24 | $table->decimal('monthly_payment', 15, 2); 25 | $table->boolean('is_activated')->default(false); 26 | $table->timestamp('activated_at')->nullable(); 27 | 28 | $table->timestamps(); 29 | 30 | $table->foreign('user_id')->references('id')->on('users'); 31 | $table->foreign('company_id')->references('id')->on('companies'); 32 | }); 33 | } 34 | 35 | /** 36 | * Reverse the migrations. 37 | * 38 | * @return void 39 | */ 40 | public function down() 41 | { 42 | Schema::dropIfExists('suppliers'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Database/Seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(SuppliersTableSeeder::class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Database/Seeders/SuppliersTableSeeder.php: -------------------------------------------------------------------------------- 1 | whereHas('role', function($query) { 16 | return $query->whereCode('company'); 17 | }) 18 | ->with('company') 19 | ->get(); 20 | 21 | $users->each(function($user) { 22 | 23 | factory(Supplier::class, 5)->create([ 24 | 'user_id' => $user->getKey(), 25 | 'company_id' => $user->company->getKey(), 26 | ]); 27 | 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Http/Controllers/SupplierGuestController.php: -------------------------------------------------------------------------------- 1 | service = $service; 23 | 24 | $this->middleware('guest'); 25 | } 26 | 27 | public function activation(int $supplierKey, Request $request) 28 | { 29 | $this->service->activation($supplierKey); 30 | 31 | return 'SUCCESS'; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Http/Resources/SupplierResource.php: -------------------------------------------------------------------------------- 1 | router->namespace('Api')->group(function ($router) { 17 | 18 | $this->router->name('suppliers.')->prefix('suppliers')->group(function ($router) { 19 | // Other routes 20 | $this->router->get('/company/amount-monthly-payment', 'SupplierController@amountSuppliersMonthlyPaymentByCompany')->name('company.amount-monthly-payment'); 21 | }); 22 | 23 | // {do} is short for domain 24 | Route::model('dosupplier', Supplier::class); 25 | Route::apiResource('suppliers', SupplierController::class)->parameters([ 26 | 'suppliers' => 'dosupplier' 27 | ]); 28 | }); 29 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Http/Routes/Web.php: -------------------------------------------------------------------------------- 1 | router->name('suppliers.')->prefix('suppliers')->group(function () { 17 | // Other routes 18 | }); 19 | 20 | // @see https://laravel.com/docs/controllers#resource-controllers 21 | $this->router->group([], function ($router) { 22 | $router->model('dosupplier', Supplier::class); 23 | $router->resource('suppliers', SupplierController::class)->parameters([ 24 | 'suppliers' => 'dosupplier' 25 | ]); 26 | }); 27 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Http/Routes/WebGuest.php: -------------------------------------------------------------------------------- 1 | router->name('suppliers.')->prefix('suppliers')->group(function () { 17 | $this->router->get('/{supplierKey}/activation', 'SupplierGuestController@activation')->name('activation')->middleware('signed'); 18 | }); 19 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Models/Traits/Boots/QueryFilterSuppliersByUsers.php: -------------------------------------------------------------------------------- 1 | check()) { 12 | static::addGlobalScope(new SuppliersOnlyCompanyScope); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Models/Traits/Scopes/SuppliersOnlyCompanyScope.php: -------------------------------------------------------------------------------- 1 | user()->isCompany()) { 22 | return $builder->whereUserId(auth()->id()); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Models/Traits/SupplierFunction.php: -------------------------------------------------------------------------------- 1 | notify( (new LinkToSupplierActivation())->delay(now()->addSeconds(10)) ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Models/Traits/SupplierRelationship.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class, 'user_id'); 18 | } 19 | 20 | /** 21 | * Belongs-to relations with Company. 22 | * 23 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo 24 | */ 25 | public function company() 26 | { 27 | return $this->belongsTo(Company::class, 'company_id'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Pipelines/SanitizeMonthlyPayment.php: -------------------------------------------------------------------------------- 1 | SupplierPolicy::class, 18 | ]; 19 | 20 | /** 21 | * Register any authentication / authorization services. 22 | * 23 | * @return void 24 | */ 25 | public function boot() 26 | { 27 | $this->registerPolicies(); 28 | 29 | // 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Providers/SupplierServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 14 | // 'column' => 'name', 15 | 'clause' => 'like' 16 | ], 17 | 'email' => [ 18 | 'column' => 'suppliers.email', 19 | 'clause' => 'like' 20 | ], 21 | 'status' => 'is_activated', 22 | ]; 23 | } 24 | 25 | protected function setToOrderBy(): Closure 26 | { 27 | return function(): void { 28 | $this->setSorting([ 29 | 'name' => 'suppliers.name', 30 | 'email' => 'suppliers.email', 31 | 'status' => 'suppliers.is_activated', 32 | //! Always required key and value even if same value 33 | 'activated_at' => 'activated_at', 34 | ]); 35 | }; 36 | } 37 | 38 | protected function setToSortBy(): Closure 39 | { 40 | return $this->setToOrderBy(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Repositories/SupplierRepository.php: -------------------------------------------------------------------------------- 1 | entity->newInstance()->fill($attributes); 38 | 39 | $wasSaved = $entity->saveOrFail(); 40 | 41 | $entity->sendLinkToSupplierActivationNotification(); 42 | 43 | $this->reset(); 44 | 45 | // event(new RepositoryEntityCreated($this, $entity)); 46 | 47 | return $wasSaved; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Resources/Views/_filter.blade.php: -------------------------------------------------------------------------------- 1 | 2 | {!! Form::open(['method' => 'GET']) !!} 3 | @filters 4 | 5 | 6 | {!! Form::text('name', input('name'), ['autofocus', 'class' => 'form-control', 'placeholder' => 'Nome do Fornecedor']) !!} 7 | 8 | 9 | {!! Form::email('email', input('email'), ['class' => 'form-control', 'placeholder' => 'E-mail do Fornecedor']) !!} 10 | 11 | 12 | 13 | {!! Form::select('status', map_status(), input('status'), ['class' => 'form-control w-75']) !!} 14 | 15 | 16 | 17 | 18 | {!! Form::button('', ['type' => 'submit', 'class' => 'btn btn-space btn-secondary btn-lg']) !!} 19 | 20 | {!! Form::close() !!} 21 | 22 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Resources/Views/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts::master') 2 | 3 | @section('pageTitle') 4 | @parent - Novo Fornecedor 5 | @stop 6 | 7 | @section('content') 8 |
9 |

Gerenciamento de Fornecedores

10 | 17 |
18 | 19 |
20 | @includeIf('suppliers::_form') 21 |
22 | @stop 23 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Resources/Views/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts::master') 2 | 3 | @section('pageTitle') 4 | @parent - Editar Fornecedor 5 | @stop 6 | 7 | @section('content') 8 |
9 |

Gerenciamento de Fornecedores

10 | 17 |
18 | 19 |
20 | @includeIf('suppliers::_form') 21 |
22 | @stop 23 | -------------------------------------------------------------------------------- /app/Domains/Suppliers/Services/SupplierService.php: -------------------------------------------------------------------------------- 1 | repository->update(['is_activated' => true, 'activated_at' => now()], $supplierKey); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Domains/Users/Console/Closures/ClosureCommands.php: -------------------------------------------------------------------------------- 1 | artisan->command('build {project}', function ($project) { 23 | // $this->info("Building {$project}!"); 24 | // }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Domains/Users/Console/Commands/UserCommand.php: -------------------------------------------------------------------------------- 1 | info("Command User Domain"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Factories/UserAdminRoleFactory.php: -------------------------------------------------------------------------------- 1 | factory->state($this->model, 'UserAdmin', function ($faker) { 16 | return $this->fields(); 17 | }); 18 | } 19 | 20 | protected function fields(): array 21 | { 22 | return [ 23 | 'role_id' => Admin::ROLE_ID, 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Factories/UserCompanyRoleFactory.php: -------------------------------------------------------------------------------- 1 | factory->state($this->model, 'UserCompany', function ($faker) { 18 | return $this->fields(); 19 | }) 20 | ->afterCreatingState($this->model, 'UserCompany', function ($user, $faker) { 21 | $user->company()->save(factory(\App\Domains\Companies\Models\Company::class)->make()); 22 | // factory(\App\Domains\Companies\Models\Company::class)->create([ 23 | // 'user_id' => $user->getKey(), 24 | // ]); 25 | }); 26 | } 27 | 28 | protected function fields(): array 29 | { 30 | return [ 31 | 'role_id' => UserCompany::ROLE_ID, 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | Str::uuid(), 19 | 'is_enabled' => $this->faker->randomElement([false, true]), 20 | 'name' => $this->faker->name, 21 | 'email' => $this->faker->unique()->safeEmail, 22 | 'email_verified_at' => now(), 23 | // 'last_login_at' => now(), 24 | 'password' => $password ?: $password = bcrypt('secret'), 25 | // 'api_token' => hash('sha256', Str::random(60)), 26 | // 'remember_token' => Str::random(10), 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Factories/UserSuperAdminRoleFactory.php: -------------------------------------------------------------------------------- 1 | factory->state($this->model, 'UserSuperAdmin', function ($faker) { 16 | return $this->fields(); 17 | }); 18 | } 19 | 20 | protected function fields(): array 21 | { 22 | // static $roleCompanyId; 23 | 24 | return [ 25 | 'role_id' => SuperAdmin::ROLE_ID, 26 | // 'role_id' => $roleCompanyId ?: $roleCompanyId = Role::where('code', 'super-admin')->firstOrFail()->getKey(), 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Migrations/2019_07_01_049635_create_roles_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 19 | 20 | $table->string('name'); 21 | $table->string('code')->unique(); 22 | $table->string('description')->nullable(); 23 | $table->unsignedSmallInteger('level')->unique(); 24 | 25 | $table->timestamps(); 26 | }); 27 | 28 | Artisan::call('db:seed', [ 29 | '--class' => 'RolesTableSeeder', 30 | '--domain' => 'Users', 31 | ]); 32 | } 33 | 34 | /** 35 | * Reverse the migrations. 36 | * 37 | * @return void 38 | */ 39 | public function down() 40 | { 41 | Schema::dropIfExists('roles'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Migrations/2019_07_01_113233_create_logins_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | 19 | $table->unsignedBigInteger('user_id'); 20 | 21 | $table->ipAddress('ip_address'); 22 | 23 | $table->timestamp('created_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('logins'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Migrations/2019_08_23_101100_add_session_id_to_users_table.php: -------------------------------------------------------------------------------- 1 | string('session_id') 18 | ->unique() 19 | ->after('api_token') 20 | ->nullable() 21 | ->default(null) 22 | ->comment('Stores the id of the user session'); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::table('users', function (Blueprint $table) { 34 | $table->dropUnique('users_session_id_unique'); 35 | $table->dropColumn('session_id'); 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Seeders/AdminsUsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | state('UserAdmin')->times(10)->create(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Seeders/CompaniesUsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | state('UserCompany')->times(10)->create(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(RolesTableSeeder::class); 17 | $this->call(SuperAdminsUsersTableSeeder::class); 18 | $this->call(AdminsUsersTableSeeder::class); 19 | $this->call(CompaniesUsersTableSeeder::class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Seeders/RolesTableSeeder.php: -------------------------------------------------------------------------------- 1 | command, 'roles', __DIR__.DIRECTORY_SEPARATOR.'SQL'.DIRECTORY_SEPARATOR.'roles.sql'); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/Domains/Users/Database/Seeders/SuperAdminsUsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | state('UserSuperAdmin')->times(5)->create([ 14 | 'is_enabled' => true, 15 | ]); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Domains/Users/Http/Routes/Api.php: -------------------------------------------------------------------------------- 1 | router->namespace('Api')->group(function ($router) { 17 | 18 | $this->router->name('users.')->prefix('users')->group(function ($router) { 19 | // Other routes 20 | }); 21 | 22 | Route::model('douser', User::class); 23 | Route::apiResource('users', UserController::class)->parameters([ 24 | 'users' => 'douser' 25 | ]); 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /app/Domains/Users/Http/Routes/Web.php: -------------------------------------------------------------------------------- 1 | router->name('users.')->prefix('users')->group(function () { 17 | // Other routes 18 | }); 19 | 20 | // @see https://laravel.com/docs/controllers#resource-controllers 21 | $this->router->group([], function ($router) { 22 | $router->model('douser', User::class); 23 | $router->resource('users', UserController::class)->parameters([ 24 | 'users' => 'douser' 25 | ]); 26 | }); 27 | -------------------------------------------------------------------------------- /app/Domains/Users/Models/Admin.php: -------------------------------------------------------------------------------- 1 | where('role_id', self::ROLE_ID); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Domains/Users/Models/Company.php: -------------------------------------------------------------------------------- 1 | where('role_id', self::ROLE_ID); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Domains/Users/Models/Role.php: -------------------------------------------------------------------------------- 1 | where('role_id', self::ROLE_ID); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Domains/Users/Models/Traits/RoleRelationship.php: -------------------------------------------------------------------------------- 1 | hasMany(User::class, 'role_id'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Domains/Users/Models/Traits/UserAccessor.php: -------------------------------------------------------------------------------- 1 | is_enabled) 12 | return 'Ativo'; 13 | 14 | return 'Inativo'; 15 | } 16 | 17 | // public function getLastLoginAtAttribute($value) 18 | // { 19 | // if (is_array($value) && array_key_exists('date', $value)) { 20 | // $value = $value['date']; 21 | // } 22 | 23 | // if (empty($value)) { 24 | // return NULL; 25 | // } 26 | 27 | // return Carbon::parse($value)->format('d/m/Y H:i'); 28 | // } 29 | } 30 | -------------------------------------------------------------------------------- /app/Domains/Users/Models/Traits/UserBoot.php: -------------------------------------------------------------------------------- 1 | load('company'); 25 | 26 | if ($user->relationLoaded('company') && 27 | ! empty($user->getRelation('company'))) { 28 | $user->company->delete(); 29 | } 30 | } 31 | 32 | return true; 33 | }); 34 | 35 | static::creating(function (self $user) { 36 | $user->uuid = (string) Str::uuid(); 37 | // $user->{$user->getKeyName()} = (string) Str::uuid(); 38 | }); 39 | 40 | // static::addGlobalScope(function ($query) { 41 | // $query->withLastLogin(); 42 | // }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Domains/Users/Models/Traits/UserFunction.php: -------------------------------------------------------------------------------- 1 | belongsTo(Login::class, 'last_login_id'); 20 | } 21 | 22 | /** 23 | * Has-One relations with Company. 24 | * 25 | * @return \Illuminate\Database\Eloquent\Relations\HasOne 26 | */ 27 | public function company() 28 | { 29 | return $this->hasOne(Company::class, 'user_id'); 30 | } 31 | 32 | /** 33 | * Has-Many relations with Supplier. 34 | * 35 | * @return \Illuminate\Database\Eloquent\Relations\HasMany 36 | */ 37 | public function suppliers() 38 | { 39 | return $this->hasMany(Supplier::class, 'user_id'); 40 | } 41 | 42 | /** 43 | * Belongs-to relations with Role. 44 | * 45 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo 46 | */ 47 | public function role() 48 | { 49 | return $this->belongsTo(Role::class, 'role_id'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Domains/Users/Models/Traits/UserScope.php: -------------------------------------------------------------------------------- 1 | addSelect([ 'last_login_date' => Login::select('created_at')->whereColumn('user_id', 'users.id')->latest()->limit(1) ]); 12 | } 13 | 14 | public function scopeWithLastLogin($query) 15 | { 16 | $query->addSelect([ 'last_login_id' => Login::select('id') 17 | ->whereColumn('user_id', 'users.id') 18 | ->latest() 19 | ->limit(1) ])->with('lastLogin'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Domains/Users/Observers/UserObserver.php: -------------------------------------------------------------------------------- 1 | UserPolicy::class, 18 | ]; 19 | 20 | /** 21 | * Register any authentication / authorization services. 22 | * 23 | * @return void 24 | */ 25 | public function boot() 26 | { 27 | $this->registerPolicies(); 28 | 29 | // 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Domains/Users/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | selectRaw( 24 | <<join('roles', 'users.role_id', '=', 'roles.id') 31 | ->with('role'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Domains/Users/Repositories/Criteria/UserPermissionCriteria.php: -------------------------------------------------------------------------------- 1 | user()->roleIs('admin')) { 22 | return $builder->whereNotIn('roles.code', ['super-admin']); 23 | } 24 | 25 | return $builder; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Domains/Users/Repositories/Filters/NameOrEmail.php: -------------------------------------------------------------------------------- 1 | where(function($query) use ($value) { 22 | $query->where('users.email', 'LIKE', "%{$value}%") 23 | ->orWhere('users.name', 'LIKE', "%{$value}%"); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Domains/Users/Repositories/RoleRepository.php: -------------------------------------------------------------------------------- 1 | pushCriteria(UserPermissionCriteria::class); 42 | 43 | $this->applyCriteria(); 44 | 45 | $results = $this->entity 46 | ->whereNotIn('roles.code', $exceptRoleCode) 47 | ->latest($columnLatest) 48 | ->get(['id', 'name']) 49 | ->pluck('name', 'id'); 50 | 51 | $this->reset(); 52 | 53 | return $results; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/Domains/Users/Repositories/UserRepository.php: -------------------------------------------------------------------------------- 1 | entity->newInstance()->fill($attributes); 42 | 43 | $wasSaved = $entity->saveOrFail(); 44 | $userKey = $entity->getKey(); 45 | 46 | $this->reset(); 47 | 48 | return $userKey; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Domains/Users/Resources/Lang/en/messages.php: -------------------------------------------------------------------------------- 1 | 'Welcome to our application' 5 | ]; 6 | -------------------------------------------------------------------------------- /app/Domains/Users/Resources/Lang/pt_BR/messages.php: -------------------------------------------------------------------------------- 1 | 'Welcome to our application' 5 | ]; 6 | -------------------------------------------------------------------------------- /app/Domains/Users/Resources/Views/_filter.blade.php: -------------------------------------------------------------------------------- 1 | @inject('roleRepository', 'App\Domains\Users\Repositories\RoleRepository') 2 | 3 | 4 | {!! Form::open(['method' => 'GET']) !!} 5 | @filters 6 | 7 | 8 | {!! Form::text('name_or_email', input('name_or_email'), ['class' => 'form-control', 'placeholder' => 'Nome ou E-mail']) !!} 9 | 10 | {!! Form::select('role', ($roleRepository->mapRoles())->prepend('Selecione', ''), input('role'), ['class' => 'form-control w-75']) !!} 11 | 12 | 13 | {!! Form::select('status', map_status(), input('status'), ['class' => 'form-control w-75']) !!} 14 | 15 | 16 | 17 | 18 | 19 | {!! Form::button(' Filtar', ['type' => 'submit', 'class' => 'btn btn-space btn-secondary btn-lg']) !!} 20 | 21 | {!! Form::close() !!} 22 | 23 | -------------------------------------------------------------------------------- /app/Domains/Users/Resources/Views/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts::master') 2 | 3 | @section('pageTitle') 4 | @parent - Novo Usuário 5 | @stop 6 | 7 | @section('content') 8 |
9 |

Gerenciamento de Usuários

10 | 17 |
18 | 19 |
20 | @includeIf('users::_form') 21 |
22 | @stop 23 | -------------------------------------------------------------------------------- /app/Domains/Users/Resources/Views/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts::master') 2 | 3 | @section('pageTitle') 4 | @parent - Editar Usuário 5 | @stop 6 | 7 | @section('content') 8 |
9 |

Gerenciamento de Usuários

10 | 17 |
18 | 19 |
20 | @includeIf('users::_form') 21 |
22 | @stop 23 | -------------------------------------------------------------------------------- /app/Domains/Users/Services/UserService.php: -------------------------------------------------------------------------------- 1 | repository->pushCriteria(JoinRoleCriteria::class); 32 | $this->repository->pushCriteria(UserPermissionCriteria::class); 33 | 34 | return [$users, $perPage] = $this->repository->paginate(app(UserBuilderFilter::class)); 35 | 36 | } catch (Throwable $e) { 37 | DB::rollback(); 38 | 39 | throw $e; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Support/Console/Routing/RouteFile.php: -------------------------------------------------------------------------------- 1 | artisan = app(Kernel::class); 15 | } 16 | 17 | public function registerCommands() 18 | { 19 | $this->commands(); 20 | } 21 | 22 | abstract protected function commands(); 23 | } 24 | -------------------------------------------------------------------------------- /app/Support/Database/Console/Factories/stubs/factory.stub: -------------------------------------------------------------------------------- 1 | signature .= " 28 | {--D|domain=* : Name of the domain folder}"; 29 | 30 | parent::__construct($migrator); 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | * 36 | * @see \Illuminate\Database\Console\Migrations\MigrateCommand::handle() 37 | */ 38 | public function handle() 39 | { 40 | parent::handle(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Support/Database/Console/Migrations/ResetCommand.php: -------------------------------------------------------------------------------- 1 | getDomainComponentNamespace('Database\\Seeders', $rootNamespace); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Support/Database/Console/Seeds/stubs/seeder.stub: -------------------------------------------------------------------------------- 1 | argument('domain'))); 18 | } 19 | 20 | /** 21 | * Get the console command arguments. 22 | * 23 | * @return array 24 | */ 25 | protected function getArguments() 26 | { 27 | $baseArguments = parent::getArguments(); 28 | 29 | $domainArgument = [ 30 | ['domain', InputArgument::REQUIRED, 'Name of the domain folder'], 31 | ]; 32 | 33 | return array_merge($baseArguments, $domainArgument); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Support/Database/Console/Traits/DomainComponentNamespace.php: -------------------------------------------------------------------------------- 1 | getDomainInput().'\\'.$domainComponentSuffixNamespace; 15 | return Arr::first(domain_component_namespace($domainComponentSuffixNamespace, $this->getDomainInput())); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Support/Database/ConsoleSupportServiceProvider.php: -------------------------------------------------------------------------------- 1 | factory = app(EloquentFactory::class); 28 | $this->faker = app(FakerGenerator::class); 29 | } 30 | 31 | protected function bootWithProviders(): void 32 | { 33 | // 34 | } 35 | 36 | public function define() 37 | { 38 | $this->bootWithProviders(); 39 | 40 | $this->factory->define($this->model, function () { 41 | return $this->fields(); 42 | }); 43 | } 44 | 45 | abstract protected function fields(): array; 46 | } 47 | -------------------------------------------------------------------------------- /app/Support/Exceptions/HttpException/BadRequestException.php: -------------------------------------------------------------------------------- 1 | getLocale()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Support/Models/BaseCollection.php: -------------------------------------------------------------------------------- 1 | email, [ 38 | // 39 | ]); 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Support/Queue/HorizonServiceProvider.php: -------------------------------------------------------------------------------- 1 | conditions = $conditions; 16 | } 17 | 18 | /** 19 | * Applies the given where conditions to the model. 20 | * 21 | * @param \Illuminate\Database\Eloquent\Builder $builder 22 | * @param \App\Support\Repository\Eloquent\Contracts\RepositoryInterface $repository 23 | * 24 | * @return \Illuminate\Database\Eloquent\Builder 25 | */ 26 | public function apply(object $builder, RepositoryInterface $repository): Builder 27 | { 28 | foreach ($this->conditions as $field => $value) { 29 | if (is_array($value)) { 30 | [$field, $condition, $value] = $value; 31 | $builder = $builder->where($field, $condition, $value); 32 | } else { 33 | $builder = $builder->where($field, $value); 34 | } 35 | } 36 | 37 | return $builder; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Filterable/Clauses/OrWhereClause.php: -------------------------------------------------------------------------------- 1 | orWhere($column, $value); 13 | } 14 | 15 | public static function parameter():? string 16 | { 17 | return 'or'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Filterable/Clauses/OrWhereLikeClause.php: -------------------------------------------------------------------------------- 1 | orWhere($column, 'LIKE', "%$value%"); 13 | } 14 | 15 | public static function parameter():? string 16 | { 17 | return 'orLike'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Filterable/Clauses/WhereClause.php: -------------------------------------------------------------------------------- 1 | where($column, $value); 13 | } 14 | 15 | public static function parameter():? string 16 | { 17 | return 'where'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Filterable/Clauses/WhereLikeClause.php: -------------------------------------------------------------------------------- 1 | where($column, 'LIKE', "%$value%"); 13 | } 14 | 15 | public static function parameter():? string 16 | { 17 | return 'like'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Filterable/Constants/GroupBy.php: -------------------------------------------------------------------------------- 1 | builder = $builder; 24 | 25 | array_map([$this, 'appendGroupBy'], array_filter(explode(',', $value))); 26 | 27 | return $this->builder; 28 | } 29 | 30 | private function appendGroupBy(string $column): void 31 | { 32 | if (! array_key_exists($column, $this->group)) { 33 | return; 34 | } 35 | 36 | $this->builder = $this->builder->groupBy(DB::raw($this->group[$column])); 37 | } 38 | 39 | public function setGroup(array $group): void 40 | { 41 | $this->group = $group; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Filterable/Constants/Limit.php: -------------------------------------------------------------------------------- 1 | limit((int) $value); 18 | 19 | $withLimit->getModel()->setPerPage((int) $value); 20 | 21 | return $withLimit; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Filterable/Constants/Page.php: -------------------------------------------------------------------------------- 1 | getQuery()->limit ?? $builder->getModel()->getPerPage(); 18 | 19 | $withPage = $builder->forPage((int) $value, $limit); 20 | 21 | return $withPage; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Filterable/Constants/SortBy.php: -------------------------------------------------------------------------------- 1 | sorting)) { 24 | return $builder; 25 | } 26 | 27 | $withSortBy = $builder->orderBy(DB::raw($this->sorting[$column]), request('sort_order') ?? 'DESC'); 28 | 29 | return $withSortBy; 30 | } 31 | 32 | public function setSorting(array $sorting): void 33 | { 34 | $this->sorting = $sorting; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Filterable/Contracts/ClausesInterface.php: -------------------------------------------------------------------------------- 1 | entity->newInstance()->fill($attributes); 19 | 20 | $wasSaved = $entity->saveOrFail(); 21 | 22 | $this->reset(); 23 | 24 | // event(new RepositoryEntityCreated($this, $entity)); 25 | 26 | return $wasSaved; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Support/Repository/Eloquent/Operations/RepositoryUpdate.php: -------------------------------------------------------------------------------- 1 | entity->findOrFail($model); 21 | 22 | $model->fill($attributes); 23 | 24 | $wasSaved = $model->saveOrFail(); 25 | 26 | $this->reset(); 27 | 28 | // event(new RepositoryEntityUpdated($this, $model)); 29 | 30 | return $wasSaved; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Support/Repository/Exceptions/RepositoryException.php: -------------------------------------------------------------------------------- 1 | repository = $repository; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Support/Service/Operations/ServiceCreate.php: -------------------------------------------------------------------------------- 1 | repository->store($attributes); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/Support/Service/Operations/ServiceDelete.php: -------------------------------------------------------------------------------- 1 | repository->destroy($ids); 15 | } 16 | 17 | /** 18 | * @param int|\Illuminate\Database\Eloquent\Model $modelOrId 19 | * 20 | * @return bool|null 21 | */ 22 | public function delete($modelOrId):? bool 23 | { 24 | return $this->repository->delete($modelOrId); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Support/Service/Operations/ServiceUpdate.php: -------------------------------------------------------------------------------- 1 | repository->update($attributes, $modelOrId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/Support/Specifications/AbstractPermissionSpecification.php: -------------------------------------------------------------------------------- 1 | allow($this->permission); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Support/Specifications/AbstractRoleSpecification.php: -------------------------------------------------------------------------------- 1 | hasRole($this->role); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Support/Specifications/AndSpecification.php: -------------------------------------------------------------------------------- 1 | specifications = $specifications; 15 | } 16 | 17 | public function isSatisfiedBy(User $user): bool 18 | { 19 | foreach ($this->specifications as $specification) { 20 | if (! $specification->isSatisfiedBy($user)) { 21 | return false; 22 | } 23 | } 24 | 25 | return true; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Support/Specifications/Contracts/Specification.php: -------------------------------------------------------------------------------- 1 | specification = $specification; 15 | } 16 | 17 | public function isSatisfiedBy(User $user): bool 18 | { 19 | return ! $this->specification->isSatisfiedBy($user); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Support/Specifications/OrSpecification.php: -------------------------------------------------------------------------------- 1 | specification = $specification; 15 | } 16 | 17 | public function isSatisfiedBy(User $user): bool 18 | { 19 | foreach ($this->specification as $specification) { 20 | if ($specification->isSatisfiedBy($user)) { 21 | return true; 22 | } 23 | } 24 | 25 | return false; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Support/SupportServiceProvider.php: -------------------------------------------------------------------------------- 1 | loadViewsFrom(resource_path('views/layouts'), 'layouts'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Support/View/ViewServiceProvider.php: -------------------------------------------------------------------------------- 1 | middleware('guest:web'); 30 | } 31 | 32 | /** 33 | * Display the form to request a password reset link. 34 | * 35 | * @return \Illuminate\Http\Response 36 | */ 37 | public function showLinkRequestForm() 38 | { 39 | return view('auth::passwords.email'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Units/Auth/Http/Middleware/CheckRole.php: -------------------------------------------------------------------------------- 1 | user()->hasRole($roles)) { 22 | return $next($request); 23 | } 24 | 25 | if ($request->expectsJson()) { 26 | //TODO: 27 | } 28 | 29 | throw new ForbiddenException(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Units/Auth/Http/Resources/UserResource.php: -------------------------------------------------------------------------------- 1 | $this->name, 34 | 'email' => $this->email, 35 | ]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Units/Auth/Http/Routes/Api.php: -------------------------------------------------------------------------------- 1 | namespace('Api')->group(function () { 15 | 16 | $this->router->post('password/email', 'ForgotPasswordController@sendResetLinkEmail')->name('password.email'); 17 | $this->router->put('password/reset', 'ResetPasswordController@reset')->name('password.reset'); 18 | 19 | // User login Api [Authentication] 20 | $this->router->post('login', 'AuthController@login')->name('login'); 21 | 22 | // Refresh Token 23 | $this->router->put('refresh', 'AuthController@refresh')->name('refresh'); 24 | 25 | // Register user and login 26 | $this->router->post('register', 'RegisterController@register')->name('register'); 27 | 28 | $this->router->name('logged.')->middleware(['auth.api'])->group(function () { 29 | // Add Token to Blacklist 30 | $this->router->delete('logout', 'AuthController@logout')->name('logout'); 31 | 32 | /* Profile Current User Authenticate */ 33 | $this->router->get('profile', 'MeController@profile')->name('me.profile'); 34 | $this->router->put('profile', 'MeController@update')->name('me.profile.update'); 35 | }); 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /app/Units/Auth/Listeners/SendEmailSuccessfullyVerifiedNotification.php: -------------------------------------------------------------------------------- 1 | user->notify(new EmailSuccessfullyVerifiedNotification()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Units/Auth/Listeners/SendPasswordSuccessfullyResetNotification.php: -------------------------------------------------------------------------------- 1 | user->notify(new PasswordSuccessfullyResetNotification()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Units/Auth/Listeners/SendVerifyEmailNotification.php: -------------------------------------------------------------------------------- 1 | user instanceof MustVerifyEmail && ! $event->user->hasVerifiedEmail()) { 19 | // Send the email verification notification 20 | $event->user->sendEmailVerificationNotification(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Units/Auth/Notifications/EmailSuccessfullyVerified.php: -------------------------------------------------------------------------------- 1 | subject(Lang::get('E-mail successfully verified')) 46 | ->greeting(Lang::get('Success 😃')) 47 | ->line('') 48 | ->line(Lang::get('Your email has been verified successfully. Now you can use all the system features! 🏆')); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Units/Auth/Notifications/PasswordSuccessfullyReset.php: -------------------------------------------------------------------------------- 1 | subject(Lang::get('Password successfully reset')) 46 | ->greeting(Lang::get('Success 😃')) 47 | ->line('') 48 | ->line(Lang::get('Your password has been reset successfully. Use the new credentials to access the system.')); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Units/Auth/Notifications/ResetPasswordNotificationToMail.php: -------------------------------------------------------------------------------- 1 | subject(Lang::get('Reset Password Notification')) 22 | ->line(Lang::get('You are receiving this email because we received a password reset request for your account.')) 23 | ->action(Lang::get('Reset Password'), url(config('app.url').route('password.reset', ['token' => $token, 'email' => $notifiable->getEmailForPasswordReset()], false))) 24 | ->line(Lang::get('This password reset link will expire in :count minutes.', ['count' => config('auth.passwords.'.config('auth.defaults.passwords').'.expire')])) 25 | ->line(Lang::get('If you did not request a password reset, no further action is required.')); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Units/Auth/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 18 | ]; 19 | 20 | /** 21 | * Register any authentication / authorization services. 22 | * 23 | * @return void 24 | */ 25 | public function boot() 26 | { 27 | $this->registerPolicies(); 28 | 29 | Gate::define('role', function ($user, string ...$roles) { 30 | return $user->hasRole($roles); 31 | }); 32 | 33 | Gate::define('permission', function ($user, string ...$roles) { 34 | return $user->hasRole($roles, true); 35 | }); 36 | 37 | Gate::define('roleIs', function ($user, string $role) { 38 | return $user->roleIs(Str::kebab($role)); 39 | }); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Units/Auth/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 22 | SendVerifyEmailNotification::class, 23 | ], 24 | Verified::class => [ 25 | SendEmailSuccessfullyVerifiedNotification::class, 26 | ], 27 | PasswordReset::class => [ 28 | SendPasswordSuccessfullyResetNotification::class 29 | ], 30 | ]; 31 | 32 | /** 33 | * Register any events for your application. 34 | * 35 | * @return void 36 | */ 37 | public function boot() 38 | { 39 | parent::boot(); 40 | 41 | // 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Units/Auth/Services/OneSessionPerUser.php: -------------------------------------------------------------------------------- 1 | user = $user; 15 | } 16 | 17 | public function execute(): User 18 | { 19 | if (! empty($previousSession = $this->user->session_id)) { 20 | Session::getHandler()->destroy($previousSession); 21 | } 22 | 23 | $this->user->forceFill([ 24 | 'session_id' => Session::getId(), 25 | ])->save(); 26 | 27 | return $this->user; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Units/Auth/Services/StoreUserAndCompany.php: -------------------------------------------------------------------------------- 1 | userRepository = $userRepository; 19 | $this->companyRepository = $companyRepository; 20 | } 21 | 22 | public function execute(array $data): User 23 | { 24 | ['user' => $dataUser, 'company' => $dataCompany] = $data; 25 | 26 | $dataUser = array_merge($dataUser, ['password' => bcrypt($dataUser['password']), 'is_enabled' => true]); 27 | $dataUser['role_id'] = (Role::whereCode('company')->firstOrFail())->getKey(); 28 | 29 | $userKey = $this->userRepository->storeKeyResult($dataUser); 30 | 31 | $dataCompany['user_id'] = $userKey; 32 | 33 | $this->companyRepository->store($dataCompany); 34 | 35 | event(new Registered($user = User::findOrFail($userKey))); 36 | 37 | return $user; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Units/Auth/Services/UpdateUserLastLogin.php: -------------------------------------------------------------------------------- 1 | user = $user; 15 | } 16 | 17 | public function execute(): User 18 | { 19 | $login = app(Login::class); 20 | $login->fill([ 21 | 'user_id' => $this->user->getKey(), 22 | 'ip_address' => request()->getClientIp(), 23 | ]); 24 | $login->saveQuietly(); 25 | 26 | $this->user->forceFill([ 27 | 'last_login_at' => now(), 28 | 'last_login_id' => $login->getKey(), 29 | ])->save(); 30 | 31 | return $this->user; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Units/Dashboard/Http/Routes/Web.php: -------------------------------------------------------------------------------- 1 | middleware('auth:web', 'role:_all')->group(function () { 17 | $this->router->get('/', [DashboardController::class, 'index'])->name('index'); 18 | }); 19 | -------------------------------------------------------------------------------- /app/Units/Dashboard/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapWebRoutes(); 30 | 31 | // 32 | } 33 | 34 | /** 35 | * Define the "web" routes for the application. 36 | * 37 | * These routes all receive session state, CSRF protection, etc. 38 | * 39 | * @return void 40 | */ 41 | protected function mapWebRoutes() 42 | { 43 | Route::middleware('web') 44 | ->as('dashboard.') 45 | ->group(unit_route_file(self::__UNIT, 'Web.php')); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/Units/Dashboard/Providers/UnitServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->register(RouteServiceProvider::class); 17 | } 18 | 19 | /** 20 | * Bootstrap any application services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'dashboard'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | Spatie\Cors\CorsProfile\DefaultProfile::class, 6 | 7 | /* 8 | * This configuration is used by `DefaultProfile`. 9 | */ 10 | 'default_profile' => [ 11 | 12 | 'allow_credentials' => false, 13 | 14 | 'allow_origins' => [ 15 | '*', 16 | ], 17 | 18 | 'allow_methods' => [ 19 | 'POST', 20 | 'GET', 21 | 'OPTIONS', 22 | 'PUT', 23 | 'PATCH', 24 | 'DELETE', 25 | ], 26 | 27 | 'allow_headers' => [ 28 | 'Content-Type', 29 | 'X-Auth-Token', 30 | 'Origin', 31 | 'Authorization', 32 | ], 33 | 34 | 'expose_headers' => [ 35 | 'Cache-Control', 36 | 'Content-Language', 37 | 'Content-Type', 38 | 'Expires', 39 | 'Last-Modified', 40 | 'Pragma', 41 | ], 42 | 43 | 'forbidden_response' => [ 44 | 'message' => 'Forbidden (cors).', 45 | 'status' => 403, 46 | ], 47 | 48 | /* 49 | * Preflight request will respond with value for the max age header. 50 | */ 51 | 'max_age' => 60 * 60 * 24, 52 | ], 53 | ]; 54 | -------------------------------------------------------------------------------- /config/flare.php: -------------------------------------------------------------------------------- 1 | env('FLARE_KEY'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Reporting Options 21 | |-------------------------------------------------------------------------- 22 | | 23 | | These options determine which information will be transmitted to Flare. 24 | | 25 | */ 26 | 27 | 'reporting' => [ 28 | 'anonymize_ips' => true, 29 | 'collect_git_information' => false, 30 | 'report_queries' => true, 31 | 'report_query_bindings' => true, 32 | 'report_view_data' => true, 33 | ], 34 | ]; 35 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | 'stripe' => [ 34 | 'model' => App\User::class, 35 | 'key' => env('STRIPE_KEY'), 36 | 'secret' => env('STRIPE_SECRET'), 37 | 'webhook' => [ 38 | 'secret' => env('STRIPE_WEBHOOK_SECRET'), 39 | 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), 40 | ], 41 | ], 42 | 43 | ]; 44 | -------------------------------------------------------------------------------- /config/tinker.php: -------------------------------------------------------------------------------- 1 | [ 17 | // App\Console\Commands\ExampleCommand::class, 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Alias Blacklist 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Typically, Tinker automatically aliases classes as you require them in 26 | | Tinker. However, you may wish to never alias certain classes, which 27 | | you may accomplish by listing the classes in the following array. 28 | | 29 | */ 30 | 31 | 'dont_alias' => [], 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /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 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 20 | return [ 21 | 'name' => $faker->name, 22 | 'email' => $faker->unique()->safeEmail, 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | }); 28 | -------------------------------------------------------------------------------- /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_06_21_011028_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->text('connection'); 19 | $table->text('queue'); 20 | $table->longText('payload'); 21 | $table->longText('exception'); 22 | $table->timestamp('failed_at')->useCurrent(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('failed_jobs'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2019_06_21_011208_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('queue')->index(); 19 | $table->longText('payload'); 20 | $table->unsignedTinyInteger('attempts'); 21 | $table->unsignedInteger('reserved_at')->nullable(); 22 | $table->unsignedInteger('available_at'); 23 | $table->unsignedInteger('created_at'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('jobs'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2019_06_21_011231_create_sessions_table.php: -------------------------------------------------------------------------------- 1 | string('id')->unique(); 18 | $table->unsignedBigInteger('user_id')->nullable(); 19 | $table->string('ip_address', 45)->nullable(); 20 | $table->text('user_agent')->nullable(); 21 | $table->text('payload'); 22 | $table->integer('last_activity'); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('sessions'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2019_06_21_011249_create_notifications_table.php: -------------------------------------------------------------------------------- 1 | uuid('id')->primary(); 18 | $table->string('type'); 19 | $table->morphs('notifiable'); 20 | $table->text('data'); 21 | $table->timestamp('read_at')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('notifications'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2019_06_21_011302_create_cache_table.php: -------------------------------------------------------------------------------- 1 | string('key')->unique(); 18 | $table->mediumText('value'); 19 | $table->integer('expiration'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('cache'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "npm run development -- --watch", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "@fortawesome/fontawesome-free": "^5.9.0", 14 | "@mdi/font": "^4.4.95", 15 | "animate.css": "^3.7.2", 16 | "axios": "^0.19", 17 | "bootstrap": "^4.3.0", 18 | "bs-custom-file-input": "^1.3.2", 19 | "bs4-breakpoint-check": "^1.2.0", 20 | "cross-env": "^5.1", 21 | "fastclick": "^1.0.6", 22 | "jquery": "^3.3", 23 | "jquery-touchswipe": "^1.6.19", 24 | "laravel-mix": "^4.0.7", 25 | "lodash": "^4.17.5", 26 | "perfect-scrollbar": "^1.4.0", 27 | "popper.js": "^1.14", 28 | "resolve-url-loader": "^2.3.1", 29 | "sass": "^1.15.2", 30 | "sass-loader": "^7.1.0", 31 | "sweetalert2": "^8.12.1", 32 | "vue": "^2.5.17", 33 | "vue-template-compiler": "^2.6.10" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/assets/css/custom.css: -------------------------------------------------------------------------------- 1 | .app-table tr th:first-child { 2 | padding: 10px 5px 10px 15px !important 3 | } 4 | 5 | .app-table-footer { 6 | margin: 0; 7 | padding: 15px 3px 13px; 8 | background-color: #f7f7f7; 9 | border-top: 1px solid #dee2e6; 10 | } 11 | 12 | .app-table-footer .pagination { 13 | margin: 0; 14 | -webkit-box-pack: end; 15 | -ms-flex-pack: end; 16 | justify-content: flex-end; 17 | } 18 | 19 | @media (max-width: 575.98px) { 20 | .app-table-footer .pagination, .app-table-footer .table-footer-info { 21 | margin: 0; 22 | -webkit-box-pack: center; 23 | -ms-flex-pack: center; 24 | justify-content: center; 25 | } 26 | } 27 | 28 | /* ============== */ 29 | /* Dashboard Card */ 30 | /* ============== */ 31 | 32 | .dashboard-card { 33 | background-color: #FFF; 34 | color: #404E67 !important; 35 | margin-bottom: 15px; 36 | border-radius: 3px; 37 | position: relative; 38 | overflow: hidden; 39 | } 40 | 41 | .dashboard-card .green { 42 | color: #16D39A !important 43 | } 44 | 45 | .dashboard-card .red { 46 | color: #FF7588!important; 47 | } 48 | 49 | .dashboard-card .blue { 50 | color: #3598db!important; 51 | } 52 | 53 | .dashboard-card .purple { 54 | color: #9a59b5!important; 55 | } 56 | 57 | .dashboard-card .icon { 58 | margin-right: -30px; 59 | margin-top: 25px; 60 | } 61 | 62 | .dashboard-card .data-info .desc { 63 | font-size: 1.3rem; 64 | line-height: 26px; 65 | } 66 | -------------------------------------------------------------------------------- /resources/assets/images/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/avatar.png -------------------------------------------------------------------------------- /resources/assets/images/bitbucket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/bitbucket.png -------------------------------------------------------------------------------- /resources/assets/images/dribbble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/dribbble.png -------------------------------------------------------------------------------- /resources/assets/images/dropbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/dropbox.png -------------------------------------------------------------------------------- /resources/assets/images/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/github.png -------------------------------------------------------------------------------- /resources/assets/images/logo-fav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/logo-fav.png -------------------------------------------------------------------------------- /resources/assets/images/logo-symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/logo-symbol.png -------------------------------------------------------------------------------- /resources/assets/images/logo-white-xx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/logo-white-xx.png -------------------------------------------------------------------------------- /resources/assets/images/logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/logo-white.png -------------------------------------------------------------------------------- /resources/assets/images/logo-xx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/logo-xx.png -------------------------------------------------------------------------------- /resources/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/logo.png -------------------------------------------------------------------------------- /resources/assets/images/mail_chimp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/mail_chimp.png -------------------------------------------------------------------------------- /resources/assets/images/slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/images/slack.png -------------------------------------------------------------------------------- /resources/assets/libs/messenger/js/messenger-theme-flat.min.js: -------------------------------------------------------------------------------- 1 | (function(){var $,FlatMessage,spinner_template,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};$=jQuery;spinner_template='
\n \n \n \n \n \n \n
';FlatMessage=function(_super){__extends(FlatMessage,_super);function FlatMessage(){return FlatMessage.__super__.constructor.apply(this,arguments)}FlatMessage.prototype.template=function(opts){var $message;$message=FlatMessage.__super__.template.apply(this,arguments);$message.append($(spinner_template));return $message};return FlatMessage}(window.Messenger.Message);window.Messenger.themes.flat={Message:FlatMessage}}).call(this); 2 | -------------------------------------------------------------------------------- /resources/assets/libs/messenger/js/messenger-theme-future.min.js: -------------------------------------------------------------------------------- 1 | (function(){var $,FutureMessage,spinner_template,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};$=jQuery;spinner_template='
\n \n \n \n \n \n \n
';FutureMessage=function(_super){__extends(FutureMessage,_super);function FutureMessage(){return FutureMessage.__super__.constructor.apply(this,arguments)}FutureMessage.prototype.template=function(opts){var $message;$message=FutureMessage.__super__.template.apply(this,arguments);$message.append($(spinner_template));return $message};return FutureMessage}(window.Messenger.Message);window.Messenger.themes.future={Message:FutureMessage}}).call(this); 2 | -------------------------------------------------------------------------------- /resources/assets/sass/abstracts/_functions.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/sass/abstracts/_functions.scss -------------------------------------------------------------------------------- /resources/assets/sass/abstracts/_mixins.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/sass/abstracts/_mixins.scss -------------------------------------------------------------------------------- /resources/assets/sass/abstracts/_placeholders.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/sass/abstracts/_placeholders.scss -------------------------------------------------------------------------------- /resources/assets/sass/abstracts/_variables.scss: -------------------------------------------------------------------------------- 1 | // Body 2 | $body-bg: #f8fafc; 3 | 4 | // Typography 5 | $font-family-sans-serif: 'Roboto', sans-serif; 6 | $font-size-base: 1rem; 7 | $line-height-base: 1.6; 8 | 9 | // Colors 10 | $blue: #3490dc; 11 | $indigo: #6574cd; 12 | $purple: #9561e2; 13 | $pink: #f66d9b; 14 | $red: #e3342f; 15 | $orange: #f6993f; 16 | $yellow: #ffed4a; 17 | $green: #38c172; 18 | $teal: #4dc0b5; 19 | $cyan: #6cb2eb; 20 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/assets/sass/app.scss -------------------------------------------------------------------------------- /resources/assets/sass/components/_all.scss: -------------------------------------------------------------------------------- 1 | @import 'typography'; 2 | @import 'tables'; 3 | @import 'forms'; 4 | @import 'buttons'; 5 | @import 'modal'; 6 | @import 'alerts'; 7 | @import 'cards'; 8 | @import 'badges'; 9 | @import 'accordions'; 10 | @import 'breadcrumbs'; 11 | @import 'dropdowns'; 12 | @import 'pagination'; 13 | @import 'popovers'; 14 | @import 'tabs'; 15 | -------------------------------------------------------------------------------- /resources/assets/sass/components/_badges.scss: -------------------------------------------------------------------------------- 1 | /* ======================== */ 2 | /* General styles for Badge */ 3 | /* ======================== */ 4 | 5 | .badge { 6 | font-size: 0.8462rem; 7 | font-weight: 700; 8 | line-height: 1.55; 9 | border: 1px solid #d9d9d9; 10 | } 11 | 12 | .badge-primary { 13 | color: #fff; 14 | background-color: #4285f4; 15 | border: transparent; 16 | } 17 | 18 | .badge-secondary { 19 | background-color: #fff; 20 | color: #404040; 21 | } 22 | 23 | .badge-success { 24 | color: #fff; 25 | background-color: #34a853; 26 | border: transparent; 27 | } 28 | 29 | .badge-info { 30 | color: #fff; 31 | background-color: #6ba4ff; 32 | border: transparent; 33 | } 34 | 35 | .badge-warning { 36 | color: #fff; 37 | background-color: #fbbc05; 38 | border: transparent; 39 | } 40 | 41 | .badge-danger { 42 | color: #fff; 43 | background-color: #ea4335; 44 | border: transparent; 45 | } 46 | -------------------------------------------------------------------------------- /resources/assets/sass/components/_breadcrumbs.scss: -------------------------------------------------------------------------------- 1 | /* ============================= */ 2 | /* General styles for Breadcrumb */ 3 | /* ============================= */ 4 | 5 | .breadcrumb { 6 | background-color: #f5f5f5; 7 | margin-bottom: 18px; 8 | padding: 7px 20px 6px; 9 | line-height: 16px; 10 | } 11 | 12 | .breadcrumb .icon { 13 | font-size: 1.231rem; 14 | line-height: 1.2; 15 | } 16 | 17 | .breadcrumb > li + li:before { 18 | color: #4d4d4d; 19 | } 20 | 21 | .breadcrumb > .active { 22 | color: #4d4d4d; 23 | } 24 | -------------------------------------------------------------------------------- /resources/assets/sass/components/_pagination.scss: -------------------------------------------------------------------------------- 1 | /* ============================= */ 2 | /* General styles for Pagination */ 3 | /* ============================= */ 4 | 5 | .pagination { 6 | padding-left: 0; 7 | border-radius: 2px; 8 | -ms-flex-wrap: wrap; 9 | flex-wrap: wrap; 10 | } 11 | 12 | @media (max-width: 575.98px) { 13 | .page-item { 14 | margin-bottom: 5px; 15 | } 16 | } 17 | 18 | .page-item:first-child .page-link { 19 | border-radius: 2px; 20 | } 21 | 22 | .page-item:last-child .page-link { 23 | border-radius: 2px; 24 | } 25 | 26 | .pagination-rounded .page-item:first-child .page-link { 27 | border-radius: 50%; 28 | } 29 | 30 | .pagination-rounded .page-item:last-child .page-link { 31 | border-radius: 50%; 32 | } 33 | 34 | .page-link { 35 | font-size: 1.077rem; 36 | line-height: 14px; 37 | font-weight: 400; 38 | padding: 0.7692rem 0.9231rem; 39 | color: #404040; 40 | background-color: #fff; 41 | border: 1px solid #ddd; 42 | border-radius: 2px; 43 | margin-left: 4px; 44 | } 45 | 46 | .page-link > span { 47 | line-height: 12px; 48 | } 49 | 50 | .pagination-rounded .page-link { 51 | border-radius: 50%; 52 | width: 35px; 53 | height: 35px; 54 | text-align: center; 55 | line-height: 14px; 56 | } 57 | -------------------------------------------------------------------------------- /resources/assets/sass/components/_popovers.scss: -------------------------------------------------------------------------------- 1 | /* ========================== */ 2 | /* General styles for Popover */ 3 | /* ========================== */ 4 | 5 | .popover { 6 | font-size: 1rem; 7 | -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); 8 | box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); 9 | } 10 | 11 | .popover .popover-header { 12 | margin: 0; 13 | } 14 | 15 | .popover.bottom > .arrow { 16 | border-bottom-color: #f7f7f7; 17 | top: -10px; 18 | } 19 | 20 | .popover.bottom > .arrow:after { 21 | background-color: transparent; 22 | top: -2px; 23 | margin-left: -10px; 24 | border-bottom-color: rgba(0, 0, 0, 0.2); 25 | border-top-width: 1px; 26 | z-index: -1; 27 | } 28 | -------------------------------------------------------------------------------- /resources/assets/sass/vendors/bootstrap.scss: -------------------------------------------------------------------------------- 1 | // Variables 2 | @import '../abstracts/all'; 3 | 4 | // Bootstrap 5 | @import '~bootstrap/scss/bootstrap'; 6 | -------------------------------------------------------------------------------- /resources/assets/sass/vendors/fontawesome.scss: -------------------------------------------------------------------------------- 1 | // Fontawesome 2 | @import '~@fortawesome/fontawesome-free/scss/fontawesome.scss'; 3 | @import '~@fortawesome/fontawesome-free/scss/regular.scss'; 4 | @import '~@fortawesome/fontawesome-free/scss/solid.scss'; 5 | @import '~@fortawesome/fontawesome-free/scss/brands.scss'; 6 | -------------------------------------------------------------------------------- /resources/assets/sass/vendors/material-icons.scss: -------------------------------------------------------------------------------- 1 | @import '@mdi/font/scss/materialdesignicons.scss'; 2 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least eight characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/lang/pt-BR/auth.php: -------------------------------------------------------------------------------- 1 | 'Credenciais informadas não correspondem com nossos registros.', 17 | 'throttle' => 'Você realizou muitas tentativas de login. Por favor, tente novamente em :seconds segundos.', 18 | ]; 19 | -------------------------------------------------------------------------------- /resources/lang/pt-BR/pagination.php: -------------------------------------------------------------------------------- 1 | '« Anterior', 17 | 'next' => 'Próxima »', 18 | ]; 19 | -------------------------------------------------------------------------------- /resources/lang/pt-BR/passwords.php: -------------------------------------------------------------------------------- 1 | 'A senha deve conter pelo menos seis caracteres e ser igual à confirmação.', 17 | 'reset' => 'Sua senha foi redefinida!', 18 | 'sent' => 'Enviamos um link para redefinir a sua senha por e-mail.', 19 | 'token' => 'Esse código de redefinição de senha é inválido.', 20 | 'user' => 'Não conseguimos encontrar nenhum usuário com o endereço de e-mail informado.', 21 | ]; 22 | -------------------------------------------------------------------------------- /resources/views/components/filters.blade.php: -------------------------------------------------------------------------------- 1 | @empty (! $sortBy = input('sort_by')) 2 | {!! Form::hidden('sort_by', $sortBy) !!} 3 | @endempty 4 | 5 | @empty (! $sortOrder = input('sort_order')) 6 | {!! Form::hidden('sort_order', $sortOrder) !!} 7 | @endempty 8 | 9 | @empty (! $limit = input('limit')) 10 | {!! Form::hidden('limit', $limit) !!} 11 | @endempty 12 | -------------------------------------------------------------------------------- /resources/views/components/form/_common.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | {{-- Inputs que não contêm argumentos de {$value} --}} 6 | @if (in_array($type, ['password', 'file'])) 7 | {!! Form::{$type}($name, $options) !!} 8 | 9 | @elseif ($type === 'select') 10 | {!! Form::select($name, $list, $value, $options) !!} 11 | 12 | {{-- Quando não existir conteúdo no componente - representado por {$slot->toHtml()} --}} 13 | @elseif (empty($slot->toHtml())) 14 | {!! Form::{$type}($name, $value, $options) !!} 15 | 16 | @endif 17 | 18 | {{ $slot }} 19 | 20 | @if ($errors->has($name))
{{ $errors->first($name) }}
@endif 21 |
22 |
23 | -------------------------------------------------------------------------------- /resources/views/components/form/buttons.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | @if ($hasSubmit) 5 | 8 | @endif 9 | 10 | {{ $textBack }} 11 | 12 |
13 |
14 |
15 | -------------------------------------------------------------------------------- /resources/views/components/form/email.blade.php: -------------------------------------------------------------------------------- 1 | @component('components_form::_common', array_merge(['type' => 'email'], compact('name', 'textLabel', 'value', 'attributes', 'classCompAround', 'classComp', 'classLabel')))@endcomponent 2 | -------------------------------------------------------------------------------- /resources/views/components/form/file.blade.php: -------------------------------------------------------------------------------- 1 | @component('components_form::_common', array_merge(['type' => 'file'], compact('name', 'textLabel', 'attributes', 'classCompAround', 'classComp', 'classLabel'))) 2 | @if (array_key_exists('class', $attributes) && Str::contains($attributes['class'], 'inputfile')) 3 | 6 | @endif 7 | @endcomponent 8 | -------------------------------------------------------------------------------- /resources/views/components/form/group.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |
6 | 7 |
8 | 9 | {!! Form::text($name, $value, $options) !!} 10 | @if ($errors->has($name))
{{ $errors->first($name) }}
@endif 11 | 12 |
13 |
14 |
15 | -------------------------------------------------------------------------------- /resources/views/components/form/number.blade.php: -------------------------------------------------------------------------------- 1 | @component('components_form::_common', array_merge(['type' => 'number'], compact('name', 'textLabel', 'value', 'attributes', 'classCompAround', 'classComp', 'classLabel')))@endcomponent 2 | -------------------------------------------------------------------------------- /resources/views/components/form/password.blade.php: -------------------------------------------------------------------------------- 1 | @component('components_form::_common', array_merge(['type' => 'password'], compact('name', 'textLabel', 'attributes', 'classCompAround', 'classComp', 'classLabel')))@endcomponent 2 | -------------------------------------------------------------------------------- /resources/views/components/form/select.blade.php: -------------------------------------------------------------------------------- 1 | @component('components_form::_common', array_merge(['type' => 'select'], compact('list', 'name', 'textLabel', 'value', 'attributes', 'classCompAround', 'classComp', 'classLabel')))@endcomponent 2 | -------------------------------------------------------------------------------- /resources/views/components/form/text.blade.php: -------------------------------------------------------------------------------- 1 | @component('components_form::_common', array_merge(['type' => 'text'], compact('name', 'textLabel', 'value', 'attributes', 'classCompAround', 'classComp', 'classLabel')))@endcomponent 2 | -------------------------------------------------------------------------------- /resources/views/components/form/textarea.blade.php: -------------------------------------------------------------------------------- 1 | @component('components_form::_common', array_merge(['type' => 'textarea'], compact('name', 'textLabel', 'value', 'attributes', 'classCompAround', 'classComp', 'classLabel')))@endcomponent 2 | -------------------------------------------------------------------------------- /resources/views/errors/401.blade.php: -------------------------------------------------------------------------------- 1 | @extends('errors::illustrated-layout') 2 | 3 | @section('code', '401') 4 | @section('title', __('Unauthorized')) 5 | 6 | @section('image') 7 |
8 |
9 | @endsection 10 | 11 | @section('message', __('Sorry, you are not authorized to access this page.')) 12 | -------------------------------------------------------------------------------- /resources/views/errors/403.blade.php: -------------------------------------------------------------------------------- 1 | @extends('errors::illustrated-layout') 2 | 3 | @section('code', '403') 4 | @section('title', __('Forbidden')) 5 | 6 | @section('image') 7 |
8 |
9 | @endsection 10 | 11 | @section('message', __($exception->getMessage() ?: 'Sorry, you are forbidden from accessing this page.')) 12 | -------------------------------------------------------------------------------- /resources/views/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | @extends('errors::illustrated-layout') 2 | 3 | @section('code', '404') 4 | @section('title', __('Page Not Found')) 5 | 6 | @section('image') 7 |
8 |
9 | @endsection 10 | 11 | @section('message', __('Sorry, the page you are looking for could not be found.')) 12 | -------------------------------------------------------------------------------- /resources/views/errors/419.blade.php: -------------------------------------------------------------------------------- 1 | @extends('errors::illustrated-layout') 2 | 3 | @section('code', '419') 4 | @section('title', __('Page Expired')) 5 | 6 | @section('image') 7 |
8 |
9 | @endsection 10 | 11 | @section('message', __('Sorry, your session has expired. Please refresh and try again.')) 12 | -------------------------------------------------------------------------------- /resources/views/errors/429.blade.php: -------------------------------------------------------------------------------- 1 | @extends('errors::illustrated-layout') 2 | 3 | @section('code', '429') 4 | @section('title', __('Too Many Requests')) 5 | 6 | @section('image') 7 |
8 |
9 | @endsection 10 | 11 | @section('message', __('Sorry, you are making too many requests to our servers.')) 12 | -------------------------------------------------------------------------------- /resources/views/errors/500.blade.php: -------------------------------------------------------------------------------- 1 | @extends('errors::illustrated-layout') 2 | 3 | @section('code', '500') 4 | @section('title', __('Server Error')) 5 | 6 | @section('image') 7 |
8 |
9 | @endsection 10 | 11 | @section('message', __('Whoops, something went wrong on our servers.')) 12 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | @extends('errors::illustrated-layout') 2 | 3 | @section('code', '503') 4 | @section('title', __('Service Unavailable')) 5 | 6 | @section('image') 7 |
8 |
9 | @endsection 10 | 11 | @section('message', __($exception->getMessage() ?: 'Sorry, we are doing some maintenance. Please check back soon.')) 12 | -------------------------------------------------------------------------------- /resources/views/layouts/partials/footer.blade.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allysonsilva/laravel-ddd/8f9df50f01e9c4694d0d580e16af0127f3d94adf/resources/views/layouts/partials/footer.blade.php -------------------------------------------------------------------------------- /resources/views/layouts/partials/head.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | @section('pageTitle') {{ config('app.name') }} @show 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @stack('styles') 27 | 28 | -------------------------------------------------------------------------------- /resources/views/layouts/partials/scripts.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | @stack('scripts') 14 | -------------------------------------------------------------------------------- /resources/views/pages/welcome.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts::master') 2 | 3 | @section('pageTitle') 4 | @parent - Blank Page 5 | @stop 6 | 7 | @section('content') 8 |
9 |

Blank Page

10 | 17 |
18 | 19 |
20 |

Content goes here!

21 |
22 | @endsection 23 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/nginx/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/Bootstrap.php: -------------------------------------------------------------------------------- 1 | createApplication()->make(Kernel::class); 27 | 28 | $commands = [ 29 | 'config:cache', 30 | 'event:cache', 31 | ]; 32 | 33 | foreach ($commands as $command) { 34 | $console->call($command); 35 | } 36 | } 37 | 38 | public function executeAfterLastTest(): void 39 | { 40 | array_map('unlink', glob('bootstrap/cache/*.phpunit.php')); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | --------------------------------------------------------------------------------