├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bootstrap ├── module.php └── schedule.php ├── composer.json ├── config └── config.php ├── database ├── migrations │ ├── 2021_01_01_000001_create_media_table.php │ ├── 2021_01_01_000002_create_temporary_uploads_table.php │ ├── 2021_01_01_000003_create_queue_job_records_table.php │ ├── 2021_01_01_000004_create_queue_job_failures_table.php │ ├── 2021_01_01_000005_create_activity_log_table.php │ ├── 2021_01_01_000007_create_notifications_table.php │ ├── 2021_01_01_000008_create_queue_job_batches_table.php │ ├── 2021_01_01_000009_create_accessareas_table.php │ ├── 2021_01_01_000010_create_accessibles_table.php │ ├── 2021_01_01_000011_create_cache_records_table.php │ └── 2021_01_01_000012_create_cache_locks_table.php └── seeders │ └── CortexFoundationSeeder.php ├── phpstan.neon.dist ├── resources ├── images │ └── favicon │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── apple-icon-precomposed.png │ │ ├── apple-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── favicon.ico │ │ ├── favicon.png │ │ ├── favicon.svg │ │ ├── manifest.json │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ └── ms-icon-70x70.png ├── js │ └── webpack.mix.js ├── lang │ └── en │ │ ├── common.php │ │ └── messages.php ├── sass │ ├── theme-adminarea.scss │ └── theme-frontarea.scss ├── stubs │ ├── config.stub │ ├── controller.api.stub │ ├── controller.invokable.stub │ ├── controller.model.stub │ ├── controller.nested.api.stub │ ├── controller.nested.stub │ ├── controller.plain.stub │ ├── controller.stub │ ├── datatable.stub │ ├── middleware.stub │ ├── module │ │ ├── .codeclimate.yml │ │ ├── .editorconfig │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .scrutinizer.yml │ │ ├── .styleci.yml │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── phpunit.xml.dist │ ├── transformer.plain.stub │ └── transformer.stub └── views │ ├── adminarea │ ├── errors │ │ ├── 401.blade.php │ │ ├── 403.blade.php │ │ ├── 404.blade.php │ │ ├── 405.blade.php │ │ ├── 419.blade.php │ │ ├── 429.blade.php │ │ ├── 500.blade.php │ │ └── 503.blade.php │ ├── layouts │ │ ├── auth.blade.php │ │ ├── default.blade.php │ │ └── error.blade.php │ ├── pages │ │ ├── accessarea.blade.php │ │ ├── datatable-dropzone.blade.php │ │ ├── datatable-index.blade.php │ │ ├── datatable-tab.blade.php │ │ ├── import.blade.php │ │ └── index.blade.php │ └── partials │ │ ├── actions.blade.php │ │ ├── breadcrumbs.blade.php │ │ ├── footer.blade.php │ │ ├── header.blade.php │ │ ├── meta.blade.php │ │ ├── modal.blade.php │ │ ├── sidebar.blade.php │ │ └── timestamps.blade.php │ └── frontarea │ ├── errors │ ├── 401.blade.php │ ├── 403.blade.php │ ├── 404.blade.php │ ├── 405.blade.php │ ├── 419.blade.php │ ├── 429.blade.php │ ├── 500.blade.php │ └── 503.blade.php │ ├── layouts │ ├── default.blade.php │ └── error.blade.php │ ├── pages │ ├── datatable-dropzone.blade.php │ ├── datatable-index.blade.php │ ├── datatable-tab.blade.php │ └── index.blade.php │ └── partials │ ├── actions.blade.php │ ├── breadcrumbs.blade.php │ ├── footer.blade.php │ ├── header.blade.php │ ├── meta.blade.php │ ├── modal.blade.php │ └── timestamps.blade.php ├── routes ├── breadcrumbs │ ├── adminarea.php │ └── frontarea.php ├── menus │ ├── adminarea.php │ └── frontarea.php └── web │ ├── absentarea.php │ ├── adminarea.php │ ├── centralarea.php │ └── frontarea.php └── src ├── Bootstrapers └── SetRequestForConsole.php ├── Console ├── Commands │ ├── AbstractModuleCommand.php │ ├── CastMakeCommand.php │ ├── ChannelMakeCommand.php │ ├── ComponentMakeCommand.php │ ├── ConfigMakeCommand.php │ ├── ConsoleMakeCommand.php │ ├── ControllerMakeCommand.php │ ├── CoreActivateCommand.php │ ├── CoreAutoloadCommand.php │ ├── CoreDeactivateCommand.php │ ├── CoreInstallCommand.php │ ├── CoreMigrateCommand.php │ ├── CorePublishCommand.php │ ├── CoreRollbackCommand.php │ ├── CoreSeedCommand.php │ ├── CoreUnloadCommand.php │ ├── DataTableMakeCommand.php │ ├── EventCacheCommand.php │ ├── EventGenerateCommand.php │ ├── EventListCommand.php │ ├── EventMakeCommand.php │ ├── ExceptionMakeCommand.php │ ├── FactoryMakeCommand.php │ ├── GenerateIdeHelperCommand.php │ ├── InstallCommand.php │ ├── JobMakeCommand.php │ ├── KeyGenerateCommand.php │ ├── ListenerMakeCommand.php │ ├── MailMakeCommand.php │ ├── MiddlewareMakeCommand.php │ ├── MigrateCommand.php │ ├── MigrateMakeCommand.php │ ├── ModelMakeCommand.php │ ├── ModuleMakeCommand.php │ ├── NotificationMakeCommand.php │ ├── ObserverMakeCommand.php │ ├── PolicyMakeCommand.php │ ├── ProviderMakeCommand.php │ ├── PublishCommand.php │ ├── RequestMakeCommand.php │ ├── ResourceMakeCommand.php │ ├── RollbackCommand.php │ ├── RuleMakeCommand.php │ ├── ScopeMakeCommand.php │ ├── SeedCommand.php │ ├── SeederMakeCommand.php │ ├── ServeCommand.php │ ├── ShowModelCommand.php │ ├── StorageLinkCommand.php │ ├── StubPublishCommand.php │ ├── TestMakeCommand.php │ ├── TransformerMakeCommand.php │ └── VendorPublishCommand.php └── Kernel.php ├── DataTables ├── AbstractDataTable.php ├── ActivitiesDataTable.php ├── Adminarea │ └── AccessareasDataTable.php ├── LogsDataTable.php └── MediaDataTable.php ├── Events ├── AccessareaCreated.php ├── AccessareaDeleted.php ├── AccessareaRestored.php └── AccessareaUpdated.php ├── Exceptions ├── ExceptionHandler.php ├── GenericException.php └── ProtectedResourceException.php ├── Generators ├── LangJsGenerator.php └── PathGenerator.php ├── Http ├── Controllers │ ├── Absentarea │ │ └── HomeController.php │ ├── AbstractController.php │ ├── Adminarea │ │ ├── AccessareasController.php │ │ ├── GenericController.php │ │ └── HomeController.php │ ├── AuthenticatedController.php │ ├── AuthorizedController.php │ ├── Centralarea │ │ └── HomeController.php │ ├── Frontarea │ │ ├── GenericController.php │ │ └── HomeController.php │ └── UnauthenticatedController.php ├── FormRequest.php ├── Kernel.php ├── Middleware │ ├── Clockwork.php │ ├── DiscoverNavigationRoutes.php │ ├── EnforceTrailingSlash.php │ ├── LocalizationRedirect.php │ ├── NotificationMiddleware.php │ ├── PreventRequestsDuringMaintenance.php │ ├── SetCrawlingRobotsHeaders.php │ ├── SetNoCacheHeaders.php │ ├── SetSessionConfigRuntime.php │ ├── TrimStrings.php │ ├── TrimWww.php │ ├── TrustHosts.php │ ├── TrustProxies.php │ ├── UnbindRouteParameters.php │ └── VerifyCsrfToken.php ├── Request.php └── Requests │ ├── Adminarea │ └── AccessareaFormRequest.php │ ├── ImageFormRequest.php │ └── ImportFormRequest.php ├── Importers ├── InsertImporter.php └── UpsertImporter.php ├── Loaders └── FileLoader.php ├── Models ├── AbstractModel.php ├── Accessarea.php ├── Log.php └── Media.php ├── Overrides ├── Appstract │ └── Opcache │ │ └── OpcacheServiceProvider.php ├── Barryvdh │ └── Debugbar │ │ └── DebugbarServiceProvider.php ├── Diglactic │ └── Breadcrumbs │ │ └── Manager.php ├── Illuminate │ ├── Foundation │ │ ├── Application.php │ │ ├── Events │ │ │ └── DiscoverEvents.php │ │ └── PackageManifest.php │ ├── Routing │ │ ├── Redirector.php │ │ ├── RouteUrlGenerator.php │ │ └── UrlGenerator.php │ └── Session │ │ ├── DatabaseSessionHandler.php │ │ ├── EncryptedStore.php │ │ ├── SessionManager.php │ │ └── Store.php ├── Lord │ └── Laroute │ │ ├── Console │ │ └── Commands │ │ │ └── LarouteGeneratorCommand.php │ │ ├── LarouteServiceProvider.php │ │ └── Routes │ │ └── Collection.php ├── Mariuzzo │ └── LaravelJsLocalization │ │ └── Commands │ │ └── LangJsCommand.php ├── Mcamara │ └── LaravelLocalization │ │ └── LaravelLocalization.php └── Yajra │ └── DataTables │ └── Html │ └── Builder.php ├── Providers ├── ArtisanServiceProvider.php ├── BootServiceProvider.php ├── ConsoleSupportServiceProvider.php ├── DiscoveryServiceProvider.php ├── FoundationServiceProvider.php ├── MigrationServiceProvider.php ├── RoutingServiceProvider.php ├── SessionServiceProvider.php └── TranslationServiceProvider.php ├── Support └── helpers.php ├── Traits ├── Accessible.php ├── Auditable.php ├── AuthorizesRequests.php └── ConsoleMakeModuleCommand.php ├── Transformers ├── AccessareaTransformer.php ├── ActivityTransformer.php ├── DataArrayTransformer.php ├── LogTransformer.php └── MediaTransformer.php ├── Validators └── Validator.php └── Verifiers └── EloquentPresenceVerifier.php /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guide 2 | 3 | This project adheres to the following standards and practices. 4 | 5 | 6 | ## Versioning 7 | 8 | This project is versioned under the [Semantic Versioning](http://semver.org/) guidelines as much as possible. 9 | 10 | Releases will be numbered with the following format: 11 | 12 | - `..` 13 | - `..` 14 | 15 | And constructed with the following guidelines: 16 | 17 | - Breaking backward compatibility bumps the major and resets the minor and patch. 18 | - New additions without breaking backward compatibility bump the minor and reset the patch. 19 | - Bug fixes and misc changes bump the patch. 20 | 21 | 22 | ## Pull Requests 23 | 24 | The pull request process differs for new features and bugs. 25 | 26 | Pull requests for bugs may be sent without creating any proposal issue. If you believe that you know of a solution for a bug that has been filed, please leave a comment detailing your proposed fix or create a pull request with the fix mentioning that issue id. 27 | 28 | 29 | ## Coding Standards 30 | 31 | This project follows the FIG PHP Standards Recommendations compliant with the [PSR-1: Basic Coding Standard](http://www.php-fig.org/psr/psr-1/), [PSR-2: Coding Style Guide](http://www.php-fig.org/psr/psr-2/) and [PSR-4: Autoloader](http://www.php-fig.org/psr/psr-4/) to ensure a high level of interoperability between shared PHP code. If you notice any compliance oversights, please send a patch via pull request. 32 | 33 | 34 | ## Feature Requests 35 | 36 | If you have a proposal or a feature request, you may create an issue with `[Proposal]` in the title. 37 | 38 | The proposal should also describe the new feature, as well as implementation ideas. The proposal will then be reviewed and either approved or denied. Once a proposal is approved, a pull request may be created implementing the new feature. 39 | 40 | 41 | ## Git Flow 42 | 43 | This project follows [Git-Flow](http://nvie.com/posts/a-successful-git-branching-model/), and as such has `master` (latest stable releases), `develop` (latest WIP development) and X.Y support branches (when there's multiple major versions). 44 | 45 | Accordingly all pull requests MUST be sent to the `develop` branch. 46 | 47 | > **Note:** Pull requests which do not follow these guidelines will be closed without any further notice. 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2021, Rinvex LLC, 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /bootstrap/schedule.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 9 | }; 10 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000001_create_media_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->morphs('model'); 19 | $table->uuid('uuid')->nullable(); 20 | $table->string('collection_name'); 21 | $table->string('name'); 22 | $table->string('file_name'); 23 | $table->string('mime_type')->nullable(); 24 | $table->string('disk'); 25 | $table->string('conversions_disk')->nullable(); 26 | $table->integer('size')->unsigned(); 27 | $table->json('manipulations'); 28 | $table->json('custom_properties'); 29 | $table->json('generated_conversions'); 30 | $table->json('responsive_images'); 31 | $table->integer('order_column')->unsigned()->nullable(); 32 | $table->nullableTimestamps(); 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | */ 39 | public function down() 40 | { 41 | Schema::dropIfExists(config('cortex.foundation.tables.media')); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000002_create_temporary_uploads_table.php: -------------------------------------------------------------------------------- 1 | string('id'); 20 | $table->string('session_id')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists(config('cortex.foundation.tables.temporary_uploads')); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000003_create_queue_job_records_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 20 | $table->string('queue'); 21 | $table->longText('payload'); 22 | $table->tinyInteger('attempts')->unsigned(); 23 | $table->integer('reserved_at')->unsigned()->nullable(); 24 | $table->integer('available_at')->unsigned(); 25 | $table->integer('created_at')->unsigned(); 26 | 27 | // Indexes 28 | $table->index(['queue']); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | * 35 | * @return void 36 | */ 37 | public function down(): void 38 | { 39 | Schema::dropIfExists(config('queue.connections.database.table')); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000004_create_queue_job_failures_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 20 | $table->string('uuid')->unique(); 21 | $table->text('connection'); 22 | $table->text('queue'); 23 | $table->longText('payload'); 24 | $table->longText('exception'); 25 | $table->timestamp('failed_at')->useCurrent(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down(): void 35 | { 36 | Schema::dropIfExists(config('queue.failed.table')); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000005_create_activity_log_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('log_name'); 19 | $table->string('description'); 20 | $table->string('event')->nullable(); 21 | $table->nullableMorphs('subject', 'subject'); 22 | $table->nullableMorphs('causer', 'causer'); 23 | $table->json('properties')->nullable(); 24 | $table->uuid('batch_uuid')->nullable(); 25 | $table->timestamps(); 26 | 27 | // Indexes 28 | $table->index(['log_name']); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists(config('cortex.foundation.tables.activity_log')); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000007_create_notifications_table.php: -------------------------------------------------------------------------------- 1 | uuid('id')->primary(); 20 | $table->string('type'); 21 | $table->morphs('notifiable'); 22 | $table->json('data'); 23 | $table->timestamp('read_at')->nullable(); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down(): void 34 | { 35 | Schema::dropIfExists(config('cortex.foundation.tables.notifications')); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000008_create_queue_job_batches_table.php: -------------------------------------------------------------------------------- 1 | string('id')->primary(); 20 | $table->string('name'); 21 | $table->integer('total_jobs'); 22 | $table->integer('pending_jobs'); 23 | $table->integer('failed_jobs'); 24 | $table->text('failed_job_ids'); 25 | $table->mediumText('options')->nullable(); 26 | $table->integer('cancelled_at')->nullable(); 27 | $table->integer('created_at'); 28 | $table->integer('finished_at')->nullable(); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | * 35 | * @return void 36 | */ 37 | public function down() 38 | { 39 | Schema::dropIfExists(config('queue.batching.table')); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000009_create_accessareas_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 21 | $table->string('slug'); 22 | $table->json('name'); 23 | $table->json('description')->nullable(); 24 | $table->boolean('is_active')->default(true); 25 | $table->boolean('is_scoped')->default(true); 26 | $table->boolean('is_obscured')->default(true); 27 | $table->boolean('is_indexable')->default(true); 28 | $table->boolean('is_protected')->default(false); 29 | $table->string('prefix')->nullable(); 30 | $table->auditableAndTimestamps(); 31 | $table->softDeletes(); 32 | 33 | // Indexes 34 | $table->unique('slug'); 35 | }); 36 | } 37 | 38 | /** 39 | * Reverse the migrations. 40 | * 41 | * @return void 42 | */ 43 | public function down(): void 44 | { 45 | Schema::dropIfExists(config('cortex.foundation.tables.accessareas')); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000010_create_accessibles_table.php: -------------------------------------------------------------------------------- 1 | integer('accessarea_id')->unsigned(); 21 | $table->morphs('accessible'); 22 | $table->timestamps(); 23 | 24 | // Indexes 25 | $table->unique(['accessarea_id', 'accessible_id', 'accessible_type'], 'accessibles_ids_type_unique'); 26 | $table->foreign('accessarea_id')->references('id')->on(config('cortex.foundation.tables.accessareas')) 27 | ->onDelete('cascade')->onUpdate('cascade'); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down(): void 37 | { 38 | Schema::dropIfExists(config('cortex.foundation.tables.accessibles')); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000011_create_cache_records_table.php: -------------------------------------------------------------------------------- 1 | string('key')->primary(); 21 | $table->mediumText('value'); 22 | $table->integer('expiration'); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists(config('cortex.foundation.tables.cache_records')); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2021_01_01_000012_create_cache_locks_table.php: -------------------------------------------------------------------------------- 1 | string('key')->primary(); 21 | $table->string('owner'); 22 | $table->integer('expiration'); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists(config('cortex.foundation.tables.cache_locks')); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phpstan.neon.dist: -------------------------------------------------------------------------------- 1 | includes: 2 | - ./vendor/nunomaduro/larastan/extension.neon 3 | parameters: 4 | level: 5 5 | paths: 6 | - src 7 | -------------------------------------------------------------------------------- /resources/images/favicon/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/android-icon-144x144.png -------------------------------------------------------------------------------- /resources/images/favicon/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/android-icon-192x192.png -------------------------------------------------------------------------------- /resources/images/favicon/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/android-icon-36x36.png -------------------------------------------------------------------------------- /resources/images/favicon/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/android-icon-48x48.png -------------------------------------------------------------------------------- /resources/images/favicon/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/android-icon-72x72.png -------------------------------------------------------------------------------- /resources/images/favicon/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/android-icon-96x96.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-114x114.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-120x120.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-144x144.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-152x152.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-180x180.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-57x57.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-60x60.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-72x72.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-76x76.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon-precomposed.png -------------------------------------------------------------------------------- /resources/images/favicon/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/apple-icon.png -------------------------------------------------------------------------------- /resources/images/favicon/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /resources/images/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /resources/images/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /resources/images/favicon/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/favicon-96x96.png -------------------------------------------------------------------------------- /resources/images/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/favicon.ico -------------------------------------------------------------------------------- /resources/images/favicon/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/favicon.png -------------------------------------------------------------------------------- /resources/images/favicon/manifest.json: -------------------------------------------------------------------------------- 1 | {"name":"Rinvex Cortex","icons":[{"src":"/android-icon-36x36.png","sizes":"36x36","type":"image/png","density":"0.75"},{"src":"/android-icon-48x48.png","sizes":"48x48","type":"image/png","density":"1.0"},{"src":"/android-icon-72x72.png","sizes":"72x72","type":"image/png","density":"1.5"},{"src":"/android-icon-96x96.png","sizes":"96x96","type":"image/png","density":"2.0"},{"src":"/android-icon-144x144.png","sizes":"144x144","type":"image/png","density":"3.0"},{"src":"/android-icon-192x192.png","sizes":"192x192","type":"image/png","density":"4.0"}]} 2 | -------------------------------------------------------------------------------- /resources/images/favicon/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/ms-icon-144x144.png -------------------------------------------------------------------------------- /resources/images/favicon/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/ms-icon-150x150.png -------------------------------------------------------------------------------- /resources/images/favicon/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/ms-icon-310x310.png -------------------------------------------------------------------------------- /resources/images/favicon/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rinvex/cortex-foundation-classic/9135d8cadddb62899179f636326393061abb9786/resources/images/favicon/ms-icon-70x70.png -------------------------------------------------------------------------------- /resources/js/webpack.mix.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | scanForCssSelectors: [], 3 | webpackPlugins: [], 4 | safelist: [], 5 | install: [], 6 | copy: [ 7 | {from: 'app/modules/cortex/foundation/resources/images/', to: 'public/images/'}, 8 | {from: 'node_modules/tinymce/plugins', to: 'public/tinymce/plugins/'}, 9 | {from: 'node_modules/tinymce/skins/', to: 'public/tinymce/skins/'}, 10 | ], 11 | mix: { 12 | css: [ 13 | {input: 'app/modules/cortex/foundation/resources/sass/theme-frontarea.scss', output: 'public/css/theme-frontarea.css'}, 14 | {input: 'app/modules/cortex/foundation/resources/sass/theme-adminarea.scss', output: 'public/css/theme-adminarea.css'}, 15 | ], 16 | js: [], 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /resources/lang/en/messages.php: -------------------------------------------------------------------------------- 1 | 'Congrats! Import process completed.', 8 | 'resource_saved' => 'Congrats! Requested :resource [:identifier] saved successfully.', 9 | 'resource_deleted' => 'Done! Requested :resource [:identifier] deleted successfully.', 10 | 'resource_revoked' => 'Done! Requested :resource [:identifier] revoked successfully.', 11 | 'resource_not_found' => 'Sorry! Requested :resource [:identifier] not found!', 12 | 'delete_confirmation_title' => 'Delete Confirmation', 13 | 'delete_confirmation_body' => 'Are you sure you want to delete :resource [:identifier]?', 14 | 'token_mismatch' => 'The page has expired due to inactivity. Please refresh and try again.', 15 | 'invalid_phone' => 'Invalid phone number!', 16 | 'invalid_indexing_rule' => 'An indexing rule needs to return a boolean or a string.', 17 | 'records_deleted' => 'Records deleted!', 18 | 'records_activated' => 'Records activated!', 19 | 'records_deactivated' => 'Records deactivated!', 20 | 'records_revoked' => 'Records revoked!', 21 | 'no_records_selected' => 'No selected records!', 22 | 'infinite_redirects' => 'Potentially infinite redirects detected!', 23 | 'action_unauthorized' => 'The given action is unauthorized for this resource!', 24 | 25 | ]; 26 | -------------------------------------------------------------------------------- /resources/sass/theme-adminarea.scss: -------------------------------------------------------------------------------- 1 | @import '~admin-lte/dist/css/AdminLTE'; 2 | @import '~admin-lte/dist/css/skins/skin-blue'; 3 | -------------------------------------------------------------------------------- /resources/stubs/config.stub: -------------------------------------------------------------------------------- 1 | ..` 13 | - `..` 14 | 15 | And constructed with the following guidelines: 16 | 17 | - Breaking backward compatibility bumps the major and resets the minor and patch. 18 | - New additions without breaking backward compatibility bump the minor and reset the patch. 19 | - Bug fixes and misc changes bump the patch. 20 | 21 | 22 | ## Pull Requests 23 | 24 | The pull request process differs for new features and bugs. 25 | 26 | Pull requests for bugs may be sent without creating any proposal issue. If you believe that you know of a solution for a bug that has been filed, please leave a comment detailing your proposed fix or create a pull request with the fix mentioning that issue id. 27 | 28 | 29 | ## Coding Standards 30 | 31 | This project follows the FIG PHP Standards Recommendations compliant with the [PSR-1: Basic Coding Standard](http://www.php-fig.org/psr/psr-1/), [PSR-2: Coding Style Guide](http://www.php-fig.org/psr/psr-2/) and [PSR-4: Autoloader](http://www.php-fig.org/psr/psr-4/) to ensure a high level of interoperability between shared PHP code. If you notice any compliance oversights, please send a patch via pull request. 32 | 33 | 34 | ## Feature Requests 35 | 36 | If you have a proposal or a feature request, you may create an issue with `[Proposal]` in the title. 37 | 38 | The proposal should also describe the new feature, as well as implementation ideas. The proposal will then be reviewed and either approved or denied. Once a proposal is approved, a pull request may be created implementing the new feature. 39 | 40 | 41 | ## Git Flow 42 | 43 | This project follows [Git-Flow](http://nvie.com/posts/a-successful-git-branching-model/), and as such has `master` (latest stable releases), `develop` (latest WIP development) and X.Y support branches (when there's multiple major versions). 44 | 45 | Accordingly all pull requests MUST be sent to the `develop` branch. 46 | 47 | > **Note:** Pull requests which do not follow these guidelines will be closed without any further notice. 48 | -------------------------------------------------------------------------------- /resources/stubs/module/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2021, Rinvex LLC, 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /resources/stubs/module/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | ./tests/Unit 19 | 20 | 21 | ./tests/Feature 22 | 23 | 24 | 25 | 26 | ./src 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /resources/stubs/transformer.plain.stub: -------------------------------------------------------------------------------- 1 | escape([ 26 | // 27 | ]); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /resources/stubs/transformer.stub: -------------------------------------------------------------------------------- 1 | escape([ 27 | // 28 | ]); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /resources/views/adminarea/errors/401.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::adminarea.layouts.error') 2 | 3 | @section('title', __('Unauthorized')) 4 | @section('code', '401') 5 | @section('message', __('Unauthorized')) 6 | -------------------------------------------------------------------------------- /resources/views/adminarea/errors/403.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::adminarea.layouts.error') 2 | 3 | @section('title', __('Forbidden')) 4 | @section('code', '403') 5 | @section('message', __('Forbidden')) 6 | -------------------------------------------------------------------------------- /resources/views/adminarea/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::adminarea.layouts.error') 2 | 3 | @section('title', __('Not Found')) 4 | @section('code', '404') 5 | @section('message', __('Not Found')) 6 | -------------------------------------------------------------------------------- /resources/views/adminarea/errors/405.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::adminarea.layouts.error') 2 | 3 | @section('title', __('Method not allowed')) 4 | @section('code', '405') 5 | @section('message', __('Method not allowed')) 6 | -------------------------------------------------------------------------------- /resources/views/adminarea/errors/419.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::adminarea.layouts.error') 2 | 3 | @section('title', __('Page Expired')) 4 | @section('code', '419') 5 | @section('message', __('Page Expired')) 6 | -------------------------------------------------------------------------------- /resources/views/adminarea/errors/429.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::adminarea.layouts.error') 2 | 3 | @section('title', __('Too Many Requests')) 4 | @section('code', '429') 5 | @section('message', __('Too Many Requests')) 6 | 7 | -------------------------------------------------------------------------------- /resources/views/adminarea/errors/500.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::adminarea.layouts.error') 2 | 3 | @section('title', __('Server Error')) 4 | @section('code', '500') 5 | @section('message', __('Server Error')) 6 | -------------------------------------------------------------------------------- /resources/views/adminarea/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::adminarea.layouts.error') 2 | 3 | @section('title', __('Service Unavailable')) 4 | @section('code', '503') 5 | @section('message', __('Service Unavailable')) 6 | -------------------------------------------------------------------------------- /resources/views/adminarea/layouts/auth.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @yield('title', config('app.name')) 6 | 7 | {{-- Meta Data --}} 8 | @include('cortex/foundation::adminarea.partials.meta') 9 | @stack('head-elements') 10 | 11 | {{-- Styles --}} 12 | 13 | 14 | 15 | @stack('styles') 16 | 17 | {{-- Scripts --}} 18 | 22 | 23 | 24 | @stack('vendor-scripts') 25 | 26 | 27 | 28 | 29 | {{-- Main content --}} 30 |
31 | 32 | @yield('content') 33 | 34 |
35 | 36 | {{-- Scripts --}} 37 | @stack('inline-scripts') 38 | 39 | {{-- Alerts --}} 40 | @alerts('default') 41 | 42 | 43 | -------------------------------------------------------------------------------- /resources/views/adminarea/layouts/default.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @yield('title', config('app.name')) 6 | 7 | {{-- Meta Data --}} 8 | @include('cortex/foundation::adminarea.partials.meta') 9 | @stack('head-elements') 10 | 11 | {{-- Styles --}} 12 | 13 | 14 | 15 | @stack('styles') 16 | 17 | {{-- Scripts --}} 18 | 22 | 23 | 24 | @stack('vendor-scripts') 25 | 26 | 27 | 28 | 29 | {{-- Main content --}} 30 |
31 | 32 | @include('cortex/foundation::adminarea.partials.header') 33 | @include('cortex/foundation::adminarea.partials.sidebar') 34 | 35 | @yield('content') 36 | 37 | @include('cortex/foundation::adminarea.partials.footer') 38 | 39 |
40 | 41 | {{-- Scripts --}} 42 | @stack('inline-scripts') 43 | 44 | {{-- Alerts --}} 45 | @alerts('default') 46 | 47 | 48 | -------------------------------------------------------------------------------- /resources/views/adminarea/layouts/error.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | @yield('title') 8 | 9 | {{-- Fonts --}} 10 | 11 | 12 | 13 | {{-- Styles --}} 14 | 50 | 51 | 52 |
53 |
54 | @yield('code') 55 |
56 | 57 |
58 | @yield('message') 59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /resources/views/adminarea/pages/datatable-dropzone.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Master Layout --}} 2 | @extends('cortex/foundation::adminarea.layouts.default') 3 | 4 | {{-- Page Title --}} 5 | @section('title') 6 | {{ extract_title(Breadcrumbs::render()) }} 7 | @endsection 8 | 9 | {{-- Main Content --}} 10 | @section('content') 11 | 12 |
13 |
14 |

{{ Breadcrumbs::render() }}

15 |
16 | 17 | {{-- Main content --}} 18 |
19 | 20 | 35 | 36 |
37 | 38 |
39 | 40 | @endsection 41 | 42 | @push('styles') 43 | 44 | @endpush 45 | 46 | @push('vendor-scripts') 47 | 48 | @endpush 49 | 50 | @push('inline-scripts') 51 | {!! $dataTable->scripts() !!} 52 | @endpush 53 | -------------------------------------------------------------------------------- /resources/views/adminarea/pages/datatable-index.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Master Layout --}} 2 | @extends('cortex/foundation::adminarea.layouts.default') 3 | 4 | {{-- Page Title --}} 5 | @section('title') 6 | {{ extract_title(Breadcrumbs::render()) }} 7 | @endsection 8 | 9 | {{-- Main Content --}} 10 | @section('content') 11 | 12 |
13 |
14 |

{{ Breadcrumbs::render() }}

15 |
16 | 17 | {{-- Main content --}} 18 |
19 | 20 |
21 | 22 |
23 | 24 |
25 |
26 | @yield('datatable-filters') 27 | {!! $dataTable->pusher($pusher ?? null)->routePrefix($routePrefix ?? null)->table(['id' => $id]) !!} 28 |
29 |
30 | 31 |
32 | 33 |
34 | 35 |
36 | 37 |
38 | 39 | @endsection 40 | 41 | @push('styles') 42 | 43 | @endpush 44 | 45 | @push('vendor-scripts') 46 | 47 | @endpush 48 | 49 | @push('inline-scripts') 50 | {!! $dataTable->scripts() !!} 51 | @endpush 52 | -------------------------------------------------------------------------------- /resources/views/adminarea/pages/datatable-tab.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Master Layout --}} 2 | @extends('cortex/foundation::adminarea.layouts.default') 3 | 4 | {{-- Page Title --}} 5 | @section('title') 6 | {{ extract_title(Breadcrumbs::render()) }} 7 | @endsection 8 | 9 | {{-- Main Content --}} 10 | @section('content') 11 | 12 |
13 |
14 |

{{ Breadcrumbs::render() }}

15 |
16 | 17 | {{-- Main content --}} 18 |
19 | 20 | 33 | 34 |
35 | 36 |
37 | 38 | @endsection 39 | 40 | @push('styles') 41 | 42 | @endpush 43 | 44 | @push('vendor-scripts') 45 | 46 | @endpush 47 | 48 | @push('inline-scripts') 49 | {!! $dataTable->scripts() !!} 50 | @endpush 51 | -------------------------------------------------------------------------------- /resources/views/adminarea/pages/import.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Master Layout --}} 2 | @extends('cortex/foundation::adminarea.layouts.default') 3 | 4 | {{-- Page Title --}} 5 | @section('title') 6 | {{ extract_title(Breadcrumbs::render()) }} 7 | @endsection 8 | 9 | {{-- Main Content --}} 10 | @section('content') 11 | 12 |
13 |
14 |

{{ Breadcrumbs::render() }}

15 |
16 | 17 | {{-- Main content --}} 18 |
19 | 20 | 34 | 35 |
36 | 37 |
38 | 39 | @endsection 40 | -------------------------------------------------------------------------------- /resources/views/adminarea/pages/index.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Master Layout --}} 2 | @extends('cortex/foundation::adminarea.layouts.default') 3 | 4 | {{-- Page Title --}} 5 | @section('title') 6 | {{ extract_title(Breadcrumbs::render()) }} 7 | @endsection 8 | 9 | {{-- Main Content --}} 10 | @section('content') 11 | 12 |
13 | 14 | {{-- Main content --}} 15 |
16 | 17 |
18 | 19 |
20 |

{{ trans('cortex/foundation::common.adminarea_welcome') }}

21 |

{{ trans('cortex/foundation::common.adminarea_welcome_body') }}

22 |
23 | 24 |
25 | 26 |
27 |
28 | 29 | @endsection 30 | -------------------------------------------------------------------------------- /resources/views/adminarea/partials/actions.blade.php: -------------------------------------------------------------------------------- 1 | @if(request()->user()->can('delete', $model) || request()->user()->can('create', $model)) 2 |
3 | 4 | @if (request()->user()->can('create', $model)) 5 | $model->getRouteKey()]) }}" title="{{ trans('cortex/foundation::common.replicate') }}" class="btn btn-default" style="margin: 4px"> 6 | @endif 7 | 8 | @if (request()->user()->can('delete', $model)) 9 | $model]) }}" 11 | data-modal-title="{{ trans('cortex/foundation::messages.delete_confirmation_title') }}" 12 | data-modal-button=" {{ trans('cortex/foundation::common.delete') }}" 13 | data-modal-body="{{ trans('cortex/foundation::messages.delete_confirmation_body', ['resource' => $resource, 'identifier' => $model->getRouteKey()]) }}" 14 | title="{{ trans('cortex/foundation::common.delete') }}" class="btn btn-default" style="margin: 4px"> 15 | 16 | @endif 17 | 18 |
19 | @endif 20 | -------------------------------------------------------------------------------- /resources/views/adminarea/partials/breadcrumbs.blade.php: -------------------------------------------------------------------------------- 1 | @if (count($breadcrumbs)) 2 | 3 | 14 | 15 | @endif 16 | -------------------------------------------------------------------------------- /resources/views/adminarea/partials/footer.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 5 |   6 |
7 | -------------------------------------------------------------------------------- /resources/views/adminarea/partials/header.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 8 | 21 |
22 | -------------------------------------------------------------------------------- /resources/views/adminarea/partials/modal.blade.php: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /resources/views/adminarea/partials/sidebar.blade.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /resources/views/frontarea/errors/401.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::frontarea.layouts.error') 2 | 3 | @section('title', __('Unauthorized')) 4 | @section('code', '401') 5 | @section('message', __('Unauthorized')) 6 | -------------------------------------------------------------------------------- /resources/views/frontarea/errors/403.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::frontarea.layouts.error') 2 | 3 | @section('title', __('Forbidden')) 4 | @section('code', '403') 5 | @section('message', __('Forbidden')) 6 | -------------------------------------------------------------------------------- /resources/views/frontarea/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::frontarea.layouts.error') 2 | 3 | @section('title', __('Not Found')) 4 | @section('code', '404') 5 | @section('message', __('Not Found')) 6 | -------------------------------------------------------------------------------- /resources/views/frontarea/errors/405.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::frontarea.layouts.error') 2 | 3 | @section('title', __('Method not allowed')) 4 | @section('code', '405') 5 | @section('message', __('Method not allowed')) 6 | -------------------------------------------------------------------------------- /resources/views/frontarea/errors/419.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::frontarea.layouts.error') 2 | 3 | @section('title', __('Page Expired')) 4 | @section('code', '419') 5 | @section('message', __('Page Expired')) 6 | -------------------------------------------------------------------------------- /resources/views/frontarea/errors/429.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::frontarea.layouts.error') 2 | 3 | @section('title', __('Too Many Requests')) 4 | @section('code', '429') 5 | @section('message', __('Too Many Requests')) 6 | 7 | -------------------------------------------------------------------------------- /resources/views/frontarea/errors/500.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::frontarea.layouts.error') 2 | 3 | @section('title', __('Server Error')) 4 | @section('code', '500') 5 | @section('message', __('Server Error')) 6 | -------------------------------------------------------------------------------- /resources/views/frontarea/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | @extends('cortex/foundation::frontarea.layouts.error') 2 | 3 | @section('title', __('Service Unavailable')) 4 | @section('code', '503') 5 | @section('message', __('Service Unavailable')) 6 | -------------------------------------------------------------------------------- /resources/views/frontarea/layouts/default.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @yield('title', config('app.name')) 6 | 7 | {{-- Meta Data --}} 8 | @include('cortex/foundation::frontarea.partials.meta') 9 | @stack('head-elements') 10 | 11 | {{-- Fonts --}} 12 | 13 | 14 | 15 | {{-- Styles --}} 16 | 17 | 18 | 19 | @stack('styles') 20 | 21 | {{-- Scripts --}} 22 | 26 | 27 | 28 | @stack('vendor-scripts') 29 | 30 | 31 | 32 | 33 |
34 | 35 | @include('cortex/foundation::frontarea.partials.header') 36 | 37 | @yield('content') 38 | 39 | @include('cortex/foundation::frontarea.partials.footer') 40 | 41 |
42 | 43 | {{-- Scripts --}} 44 | @stack('inline-scripts') 45 | 46 | {{-- Alerts --}} 47 | @alerts('default') 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /resources/views/frontarea/layouts/error.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | @yield('title') 8 | 9 | {{-- Fonts --}} 10 | 11 | 12 | 13 | {{-- Styles --}} 14 | 50 | 51 | 52 |
53 |
54 | @yield('code') 55 |
56 | 57 |
58 | @yield('message') 59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /resources/views/frontarea/pages/datatable-dropzone.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Master Layout --}} 2 | @extends('cortex/foundation::frontarea.layouts.default') 3 | 4 | {{-- Page Title --}} 5 | @section('title') 6 | {{ extract_title(Breadcrumbs::render()) }} 7 | @endsection 8 | 9 | {{-- Main Content --}} 10 | @section('content') 11 | 12 |
13 |
14 |

{{ Breadcrumbs::render() }}

15 |
16 | 17 | {{-- Main content --}} 18 |
19 | 20 | 35 | 36 |
37 | 38 |
39 | 40 | @endsection 41 | 42 | @push('styles') 43 | 44 | @endpush 45 | 46 | @push('vendor-scripts') 47 | 48 | @endpush 49 | 50 | @push('inline-scripts') 51 | {!! $dataTable->scripts() !!} 52 | @endpush 53 | -------------------------------------------------------------------------------- /resources/views/frontarea/pages/datatable-index.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Master Layout --}} 2 | @extends('cortex/foundation::frontarea.layouts.default') 3 | 4 | {{-- Page Title --}} 5 | @section('title') 6 | {{ extract_title(Breadcrumbs::render()) }} 7 | @endsection 8 | 9 | {{-- Main Content --}} 10 | @section('content') 11 | 12 |
13 | 14 |
15 |
16 | @include('cortex/auth::frontarea.partials.sidebar') 17 |
18 | 19 |
20 | 21 |
22 | 23 | 26 | 27 | @yield('datatable-filters') 28 | {!! $dataTable->pusher($pusher ?? null)->routePrefix($routePrefix ?? null)->table(['id' => $id]) !!} 29 | 30 |
31 |
32 |
33 | 34 |
35 | 36 | @endsection 37 | 38 | @push('styles') 39 | 40 | @endpush 41 | 42 | @push('vendor-scripts') 43 | 44 | @endpush 45 | 46 | @push('inline-scripts') 47 | {!! $dataTable->scripts() !!} 48 | @endpush 49 | -------------------------------------------------------------------------------- /resources/views/frontarea/pages/datatable-tab.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Master Layout --}} 2 | @extends('cortex/foundation::frontarea.layouts.default') 3 | 4 | {{-- Page Title --}} 5 | @section('title') 6 | {{ extract_title(Breadcrumbs::render()) }} 7 | @endsection 8 | 9 | {{-- Main Content --}} 10 | @section('content') 11 | 12 |
13 | 14 |
15 |
16 | @include('cortex/auth::frontarea.partials.sidebar') 17 |
18 | 19 |
20 | 21 |
22 | 23 | 26 | 27 | 42 | 43 |
44 | 45 |
46 | 47 |
48 | 49 |
50 | 51 | @endsection 52 | 53 | @push('styles') 54 | 55 | @endpush 56 | 57 | @push('vendor-scripts') 58 | 59 | @endpush 60 | 61 | @push('inline-scripts') 62 | {!! $dataTable->scripts() !!} 63 | @endpush 64 | -------------------------------------------------------------------------------- /resources/views/frontarea/partials/actions.blade.php: -------------------------------------------------------------------------------- 1 | @if(request()->user()->can('delete', $model) || request()->user()->can('create', $model)) 2 |
3 | 4 | @if (request()->user()->can('create', $model)) 5 | $model->getRouteKey()]) }}" title="{{ trans('cortex/foundation::common.replicate') }}" class="btn btn-default" style="margin: 4px"> 6 | @endif 7 | 8 | @if (request()->user()->can('delete', $model)) 9 | $model]) }}" 11 | data-modal-title="{{ trans('cortex/foundation::messages.delete_confirmation_title') }}" 12 | data-modal-button=" {{ trans('cortex/foundation::common.delete') }}" 13 | data-modal-body="{{ trans('cortex/foundation::messages.delete_confirmation_body', ['resource' => $resource, 'identifier' => $model->getRouteKey()]) }}" 14 | title="{{ trans('cortex/foundation::common.delete') }}" class="btn btn-default" style="margin: 4px"> 15 | 16 | @endif 17 | 18 |
19 | @endif 20 | -------------------------------------------------------------------------------- /resources/views/frontarea/partials/breadcrumbs.blade.php: -------------------------------------------------------------------------------- 1 | @if (count($breadcrumbs)) 2 | 3 | 14 | 15 | @endif 16 | -------------------------------------------------------------------------------- /resources/views/frontarea/partials/footer.blade.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /resources/views/frontarea/partials/header.blade.php: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /resources/views/frontarea/partials/modal.blade.php: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /routes/breadcrumbs/frontarea.php: -------------------------------------------------------------------------------- 1 | push(' '.config('app.name'), route('frontarea.home')); 10 | }); 11 | -------------------------------------------------------------------------------- /routes/menus/adminarea.php: -------------------------------------------------------------------------------- 1 | dropdown(function (MenuItem $dropdown) { 12 | foreach (app('laravellocalization')->getSupportedLocales() as $key => $locale) { 13 | $dropdown->url(app('laravellocalization')->localizeURL(request()->fullUrl(), $key), $locale['name']); 14 | } 15 | }, app('laravellocalization')->getCurrentLocaleNative(), 10, 'fa fa-globe'); 16 | }); 17 | } 18 | 19 | Menu::register('adminarea.sidebar', function (MenuGenerator $menu) { 20 | $menu->findByTitleOrAdd(trans('cortex/foundation::common.cms'), 40, 'fa fa-file-text-o', 'header', [], [], function (MenuItem $dropdown) { 21 | $dropdown->route(['adminarea.cortex.foundation.accessareas.index'], trans('cortex/foundation::common.accessareas'), 20, 'fa fa-files-o')->ifCan('list', app('cortex.foundation.accessarea'))->activateOnRoute('adminarea.cortex.foundation.accessareas'); 22 | }); 23 | }); 24 | 25 | Menu::register('adminarea.cortex.foundation.accessareas.tabs', function (MenuGenerator $menu, Accessarea $accessarea) { 26 | $menu->route(['adminarea.cortex.foundation.accessareas.import'], trans('cortex/foundation::common.records'))->ifCan('import', $accessarea)->if(Route::is('adminarea.cortex.foundation.accessareas.import*')); 27 | $menu->route(['adminarea.cortex.foundation.accessareas.import.logs'], trans('cortex/foundation::common.logs'))->ifCan('audit', $accessarea)->if(Route::is('adminarea.cortex.foundation.accessareas.import*')); 28 | $menu->route(['adminarea.cortex.foundation.accessareas.create'], trans('cortex/foundation::common.details'))->ifCan('create', $accessarea)->if(Route::is('adminarea.cortex.foundation.accessareas.create')); 29 | $menu->route(['adminarea.cortex.foundation.accessareas.edit', ['accessarea' => $accessarea]], trans('cortex/foundation::common.details'))->ifCan('update', $accessarea)->if($accessarea->exists); 30 | $menu->route(['adminarea.cortex.foundation.accessareas.logs', ['accessarea' => $accessarea]], trans('cortex/foundation::common.logs'))->ifCan('audit', $accessarea)->if($accessarea->exists); 31 | }); 32 | -------------------------------------------------------------------------------- /routes/menus/frontarea.php: -------------------------------------------------------------------------------- 1 | dropdown(function (MenuItem $dropdown) { 11 | foreach (app('laravellocalization')->getSupportedLocales() as $key => $locale) { 12 | $dropdown->url(app('laravellocalization')->localizeURL(request()->fullUrl(), $key), $locale['name']); 13 | } 14 | }, app('laravellocalization')->getCurrentLocaleNative(), 10, 'fa fa-globe'); 15 | }); 16 | } 17 | 18 | Menu::register('frontarea.header.navigation', function (MenuGenerator $menu) { 19 | $menu->url(route('frontarea.home'), 'Home', null, null, ['class' => 'smothscroll'])->if(! Route::is('frontarea.home')); 20 | $menu->url('#home', 'Home', null, null, ['class' => 'smothscroll'])->if(Route::is('frontarea.home')); 21 | $menu->url('#desc', 'Description', null, null, ['class' => 'smothscroll'])->if(Route::is('frontarea.home')); 22 | $menu->url('#contact', 'Contact', null, null, ['class' => 'smothscroll'])->if(Route::is('frontarea.home')); 23 | }); 24 | -------------------------------------------------------------------------------- /routes/web/absentarea.php: -------------------------------------------------------------------------------- 1 | group(function () { 8 | Route::name('absentarea.') 9 | ->middleware(['web']) 10 | ->prefix(route_prefix('absentarea'))->group(function () { 11 | // Homepage Routes 12 | Route::get('absent')->name('home')->uses([HomeController::class, 'index']); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /routes/web/adminarea.php: -------------------------------------------------------------------------------- 1 | group(function () { 10 | Route::name('adminarea.') 11 | ->middleware(['web', 'nohttpcache', 'can:access-adminarea']) 12 | ->prefix(route_prefix('adminarea'))->group(function () { 13 | // Adminarea Home route 14 | Route::get('/')->name('home')->uses([HomeController::class, 'index']); 15 | Route::post('country')->name('country')->uses([GenericController::class, 'country']); 16 | 17 | // Accessareas Routes 18 | Route::name('cortex.foundation.accessareas.')->prefix('accessareas')->group(function () { 19 | Route::match(['get', 'post'], '/')->name('index')->uses([AccessareasController::class, 'index']); 20 | Route::post('import')->name('import')->uses([AccessareasController::class, 'import']); 21 | Route::get('create')->name('create')->uses([AccessareasController::class, 'create']); 22 | Route::post('create')->name('store')->uses([AccessareasController::class, 'store']); 23 | Route::get('{accessarea}')->name('show')->uses([AccessareasController::class, 'show']); 24 | Route::get('{accessarea}/edit')->name('edit')->uses([AccessareasController::class, 'edit']); 25 | Route::put('{accessarea}/edit')->name('update')->uses([AccessareasController::class, 'update']); 26 | Route::match(['get', 'post'], '{accessarea}/logs')->name('logs')->uses([AccessareasController::class, 'logs']); 27 | Route::delete('{accessarea}')->name('destroy')->uses([AccessareasController::class, 'destroy']); 28 | }); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /routes/web/centralarea.php: -------------------------------------------------------------------------------- 1 | group(function () { 8 | Route::name('centralarea.') 9 | ->middleware(['web']) 10 | ->prefix(route_prefix('centralarea'))->group(function () { 11 | // Homepage Routes 12 | Route::get('central')->name('home')->uses([HomeController::class, 'index']); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /routes/web/frontarea.php: -------------------------------------------------------------------------------- 1 | group(function () { 9 | Route::name('frontarea.') 10 | ->middleware(['web']) 11 | ->prefix(route_prefix('frontarea'))->group(function () { 12 | // Homepage Routes 13 | Route::get('/')->name('home')->uses([HomeController::class, 'index']); 14 | Route::post('country')->name('country')->uses([GenericController::class, 'country']); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/Bootstrapers/SetRequestForConsole.php: -------------------------------------------------------------------------------- 1 | make('config')->get('app.url', 'http://localhost'); 22 | 23 | $components = parse_url($uri); 24 | 25 | $server = $_SERVER; 26 | 27 | if (isset($components['path'])) { 28 | $server = array_merge($server, [ 29 | 'SCRIPT_FILENAME' => $components['path'], 30 | 'SCRIPT_NAME' => $components['path'], 31 | ]); 32 | } 33 | 34 | $app->instance('request', Request::create( 35 | $uri, 36 | 'GET', 37 | [], 38 | [], 39 | [], 40 | $server 41 | )); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Console/Commands/CastMakeCommand.php: -------------------------------------------------------------------------------- 1 | rootNamespace(), $this->moduleName().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR, $name); 62 | 63 | if (! $this->files->exists($path = $this->laravel['path'].DIRECTORY_SEPARATOR.$this->moduleName())) { 64 | throw new \Exception("Invalid path: {$path}"); 65 | } 66 | 67 | return $this->laravel['path'].DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $name).'.php'; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Console/Commands/ConsoleMakeCommand.php: -------------------------------------------------------------------------------- 1 | option('autoload') ? $this->process(['autoload' => true, 'active' => true]) : $this->process(['active' => true]); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Console/Commands/CoreAutoloadCommand.php: -------------------------------------------------------------------------------- 1 | option('activate') ? $this->process(['autoload' => true, 'active' => true]) : $this->process(['autoload' => true]); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Console/Commands/CoreDeactivateCommand.php: -------------------------------------------------------------------------------- 1 | option('unload') ? $this->process(['autoload' => false, 'active' => false]) : $this->process(['active' => false]); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Console/Commands/CoreInstallCommand.php: -------------------------------------------------------------------------------- 1 | alert($this->description); 35 | 36 | $this->call('key:generate', ['--ansi' => true]); 37 | $this->call('storage:link', ['--force' => true]); 38 | 39 | // @TODO: temporary disable since package is outdated 40 | // $this->call('self-diagnosis'); 41 | 42 | // Publish assets only if explicitly required, otherwise skip for clean installation 43 | ! $this->option('resource') || $this->call('cortex:publish', ['--force' => $this->option('force'), '--resource' => $this->option('resource')]); 44 | 45 | $this->call('cortex:migrate', ['--force' => $this->option('force')]); 46 | $this->call('cortex:seed'); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Console/Commands/CoreSeedCommand.php: -------------------------------------------------------------------------------- 1 | filter(function ($command) { 38 | return mb_strpos($command->getName(), 'cortex:seed:') !== false; 39 | })->filter(function ($command) { 40 | return $command->getName() !== 'cortex:seed:auth'; 41 | })->flatten(); 42 | 43 | $progressBar = $this->output->createProgressBar($commands->count()); 44 | $progressBar->setBarCharacter('▒'); 45 | $progressBar->setEmptyBarCharacter('▒'); 46 | $progressBar->setProgressCharacter('➤'); 47 | $progressBar->setFormat("{$this->description}. (Step %current% / %max%)\n[%bar%] %percent%%\nElapsed Time: %elapsed%"); 48 | $progressBar->start(); 49 | 50 | $output = new BufferedOutput(); 51 | $commands->each(function (Command $command) use ($progressBar, $output) { 52 | $command->run(new ArrayInput([]), $output); 53 | $progressBar->advance(); 54 | }); 55 | 56 | $progressBar->finish(); 57 | 58 | $this->laravel['log']->channel('installer')->debug("\n".$output->fetch()); 59 | 60 | $this->line(''); 61 | $this->line(''); 62 | 63 | $this->call('cortex:seed:auth'); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Console/Commands/CoreUnloadCommand.php: -------------------------------------------------------------------------------- 1 | option('deactivate') ? $this->process(['autoload' => false, 'active' => false]) : $this->process(['autoload' => false]); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Console/Commands/EventCacheCommand.php: -------------------------------------------------------------------------------- 1 | laravel->getProviders(DiscoveryServiceProvider::class) as $provider) { 24 | $providerEvents = array_merge_recursive($provider->discoverEvents(), $provider->listens()); 25 | 26 | $events[get_class($provider)] = $providerEvents; 27 | } 28 | 29 | return $events; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Console/Commands/EventGenerateCommand.php: -------------------------------------------------------------------------------- 1 | laravel->getProviders(DiscoveryServiceProvider::class) as $provider) { 24 | $providerEvents = array_merge_recursive($provider->discoverEvents(), $provider->listens()); 25 | 26 | $events = array_merge_recursive($events, $providerEvents); 27 | } 28 | 29 | if ($this->filteringByEvent()) { 30 | $events = $this->filterEvents($events); 31 | } 32 | 33 | return collect($events)->map(function ($listeners, $event) { 34 | return ['Event' => $event, 'Listeners' => implode(PHP_EOL, $listeners)]; 35 | })->sortBy('Event')->values()->toArray(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Console/Commands/EventMakeCommand.php: -------------------------------------------------------------------------------- 1 | rootNamespace(), $this->moduleName().DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'factories'.DIRECTORY_SEPARATOR, $name); 31 | 32 | if (! $this->files->exists($path = $this->laravel['path'].DIRECTORY_SEPARATOR.$this->moduleName().DIRECTORY_SEPARATOR)) { 33 | throw new \Exception("Invalid path: $path"); 34 | } 35 | 36 | return $this->laravel['path'].DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $name).'.php'; 37 | } 38 | 39 | /** 40 | * Qualify the given model class base name. 41 | * 42 | * @param string $model 43 | * 44 | * @return string 45 | */ 46 | protected function qualifyModel(string $model) 47 | { 48 | $model = ltrim($model, '\\/'); 49 | 50 | $model = str_replace('/', '\\', $model); 51 | 52 | $rootNamespace = $this->rootNamespace(); 53 | 54 | if (Str::startsWith($model, $rootNamespace)) { 55 | return $model; 56 | } 57 | 58 | return $rootNamespace.'Models\\'.$model; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Console/Commands/GenerateIdeHelperCommand.php: -------------------------------------------------------------------------------- 1 | has('ide-helper:generate') || $this->call('ide-helper:generate', ['--ansi' => true]); 41 | 42 | ! $artisan->has('ide-helper:meta') || $this->call('ide-helper:meta', ['--ansi' => true]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Console/Commands/InstallCommand.php: -------------------------------------------------------------------------------- 1 | alert($this->description); 35 | 36 | ! $this->option('resource') || $this->call('cortex:publish:foundation', ['--force' => $this->option('force'), '--resource' => $this->option('resource')]); 37 | 38 | $this->call('cortex:migrate:foundation', ['--force' => $this->option('force')]); 39 | $this->call('cortex:seed:foundation'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Console/Commands/JobMakeCommand.php: -------------------------------------------------------------------------------- 1 | generateRandomKey(); 33 | 34 | if ($this->option('show')) { 35 | return $this->line(''.$key.''); 36 | } 37 | 38 | if ($this->option('ifnot') && Encrypter::supported($this->parseKey(config('app.key')), config('app.cipher'))) { 39 | return $this->line('There is a key already exists, no changes has been made!'); 40 | } 41 | 42 | // Next, we will replace the application key in the environment file so it is 43 | // automatically setup for this developer. This key gets generated using a 44 | // secure random byte generator and is later base64 encoded for storage. 45 | if (! $this->setKeyInEnvironmentFile($key)) { 46 | return; 47 | } 48 | 49 | $this->laravel['config']['app.key'] = $key; 50 | 51 | $this->info('Application key set successfully.'); 52 | } 53 | 54 | /** 55 | * Parse the encryption key. 56 | * 57 | * @param string $key 58 | * 59 | * @return string 60 | */ 61 | protected function parseKey(string $key) 62 | { 63 | if (Str::startsWith($key, $prefix = 'base64:')) { 64 | $key = base64_decode(Str::after($key, $prefix)); 65 | } 66 | 67 | return $key; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Console/Commands/ListenerMakeCommand.php: -------------------------------------------------------------------------------- 1 | option('event'); 29 | 30 | if (! Str::startsWith($event, [ 31 | $this->rootNamespace(), 32 | 'Illuminate', 33 | '\\', 34 | ])) { 35 | $event = $this->rootNamespace().'Events\\'.$event; 36 | } 37 | 38 | $stub = str_replace( 39 | 'DummyEvent', 40 | class_basename($event), 41 | $this->defaultBuildClass($name) 42 | ); 43 | 44 | return str_replace( 45 | 'DummyFullEvent', 46 | $event, 47 | $stub 48 | ); 49 | } 50 | 51 | /** 52 | * Build the class with the given name. 53 | * 54 | * @param string $name 55 | * 56 | * @return string 57 | */ 58 | protected function defaultBuildClass($name): string 59 | { 60 | $stub = $this->files->get($this->getStub()); 61 | 62 | return $this->replaceNamespace($stub, $name)->replaceClass($stub, $name); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Console/Commands/MailMakeCommand.php: -------------------------------------------------------------------------------- 1 | alert($this->description); 35 | 36 | $path = config('cortex.foundation.autoload_migrations') ? 37 | realpath(__DIR__.'/../../../database/migrations') : 38 | $this->laravel->databasePath('migrations/cortex/foundation'); 39 | 40 | if (file_exists($path)) { 41 | $this->call('migrate', [ 42 | '--step' => true, 43 | '--path' => $path, 44 | '--realpath' => true, 45 | '--force' => $this->option('force'), 46 | ]); 47 | } else { 48 | $this->warn('No migrations found! Consider publish them first: php artisan cortex:publish:foundation'); 49 | } 50 | 51 | $this->line(''); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Console/Commands/MigrateMakeCommand.php: -------------------------------------------------------------------------------- 1 | makeDirectory($this->getMigrationPath()); 42 | 43 | parent::writeMigration($name, $table, $create); 44 | } 45 | 46 | /** 47 | * Build the directory for the class if necessary. 48 | * 49 | * @param string $path 50 | * 51 | * @return string 52 | */ 53 | protected function makeDirectory($path): string 54 | { 55 | if (! $this->laravel['files']->isDirectory($path)) { 56 | $this->laravel['files']->makeDirectory($path, 0777, true, true); 57 | } 58 | 59 | return $path; 60 | } 61 | 62 | /** 63 | * Get migration path (either specified by '--path' or '--module' options). 64 | * 65 | * @throws \Exception 66 | * 67 | * @return string 68 | */ 69 | protected function getMigrationPath(): string 70 | { 71 | if (! $this->laravel['files']->exists($path = $this->laravel['path'].DIRECTORY_SEPARATOR.$this->moduleName())) { 72 | throw new \Exception("Invalid path: $path"); 73 | } 74 | 75 | return $path.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'migrations'; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/Console/Commands/NotificationMakeCommand.php: -------------------------------------------------------------------------------- 1 | rootNamespace(); 33 | 34 | if (Str::startsWith($model, $rootNamespace)) { 35 | return $model; 36 | } 37 | 38 | return $rootNamespace.'Models\\'.$model; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Console/Commands/PolicyMakeCommand.php: -------------------------------------------------------------------------------- 1 | rootNamespace().'User', 34 | $userModel, 35 | $stub 36 | ); 37 | } 38 | 39 | /** 40 | * Qualify the given model class base name. 41 | * 42 | * @param string $model 43 | * 44 | * @return string 45 | */ 46 | protected function qualifyModel(string $model) 47 | { 48 | $model = ltrim($model, '\\/'); 49 | 50 | $model = str_replace('/', '\\', $model); 51 | 52 | $rootNamespace = $this->rootNamespace(); 53 | 54 | if (Str::startsWith($model, $rootNamespace)) { 55 | return $model; 56 | } 57 | 58 | return $rootNamespace.'Models\\'.$model; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Console/Commands/ProviderMakeCommand.php: -------------------------------------------------------------------------------- 1 | alert($this->description); 35 | 36 | collect($this->option('resource') ?: ['config', 'lang', 'views', 'migrations'])->each(function ($resource) { 37 | $this->call('vendor:publish', ['--tag' => "cortex/foundation::{$resource}", '--force' => $this->option('force')]); 38 | }); 39 | 40 | $this->line(''); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Console/Commands/RequestMakeCommand.php: -------------------------------------------------------------------------------- 1 | alert($this->description); 35 | 36 | $path = config('cortex.foundation.autoload_migrations') ? 37 | realpath(__DIR__.'/../../../database/migrations') : 38 | $this->laravel->databasePath('migrations/cortex/foundation'); 39 | 40 | if (file_exists($path)) { 41 | $this->call('migrate:reset', [ 42 | '--path' => $path, 43 | '--realpath' => true, 44 | '--force' => $this->option('force'), 45 | ]); 46 | } else { 47 | $this->warn('No migrations found! Consider publish them first: php artisan cortex:publish:foundation'); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Console/Commands/RuleMakeCommand.php: -------------------------------------------------------------------------------- 1 | alert($this->description); 36 | 37 | $this->call('db:seed', ['--class' => CortexFoundationSeeder::class]); 38 | 39 | $this->line(''); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Console/Commands/SeederMakeCommand.php: -------------------------------------------------------------------------------- 1 | moduleName().DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'seeds'.DIRECTORY_SEPARATOR.$name; 30 | 31 | if (! $this->files->exists($path = $this->laravel['path'].DIRECTORY_SEPARATOR.$this->moduleName().DIRECTORY_SEPARATOR)) { 32 | throw new \Exception("Invalid path: $path"); 33 | } 34 | 35 | return $this->laravel['path'].DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $name).'.php'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Console/Commands/ServeCommand.php: -------------------------------------------------------------------------------- 1 | warn($string); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Console/Commands/StubPublishCommand.php: -------------------------------------------------------------------------------- 1 | resource->actions(); 31 | 32 | return $this->scope()->applyScopes($query); 33 | } 34 | 35 | /** 36 | * Get columns. 37 | * 38 | * @return array 39 | */ 40 | protected function getColumns(): array 41 | { 42 | return [ 43 | 'id' => ['checkboxes' => json_decode('{"selectRow": true}'), 'exportable' => false, 'printable' => false], 44 | 'details' => ['title' => '', 'data' => null, 'defaultContent' => '', 'class' => 'dt-details-control', 'searchable' => false, 'orderable' => false], 45 | 'subject' => ['title' => trans('cortex/foundation::common.subject'), 'name' => 'subject.name', 'searchable' => false, 'orderable' => false, 'render' => 'full.subject_route ? ""+data+"" : data', 'responsivePriority' => 0], 46 | 'description' => ['title' => trans('cortex/foundation::common.description'), 'orderable' => false], 47 | 'created_at' => ['title' => trans('cortex/foundation::common.date'), 'render' => "moment(data).format('YYYY-MM-DD, hh:mm:ss A')"], 48 | ]; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Events/AccessareaCreated.php: -------------------------------------------------------------------------------- 1 | model = $accessarea; 42 | } 43 | 44 | /** 45 | * Get the channels the event should broadcast on. 46 | * 47 | * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[] 48 | */ 49 | public function broadcastOn() 50 | { 51 | return [ 52 | new PrivateChannel('cortex.foundation.accessareas.index'), 53 | ]; 54 | } 55 | 56 | /** 57 | * The event's broadcast name. 58 | * 59 | * @return string 60 | */ 61 | public function broadcastAs() 62 | { 63 | return 'accessarea.created'; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Events/AccessareaDeleted.php: -------------------------------------------------------------------------------- 1 | model = $accessarea->withoutRelations(); 40 | } 41 | 42 | /** 43 | * Get the channels the event should broadcast on. 44 | * 45 | * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[] 46 | */ 47 | public function broadcastOn() 48 | { 49 | return [ 50 | new PrivateChannel('cortex.foundation.accessareas.index'), 51 | new PrivateChannel("cortex.foundation.accessareas.{$this->model->getRouteKey()}"), 52 | ]; 53 | } 54 | 55 | /** 56 | * The event's broadcast name. 57 | * 58 | * @return string 59 | */ 60 | public function broadcastAs() 61 | { 62 | return 'accessarea.deleted'; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Events/AccessareaRestored.php: -------------------------------------------------------------------------------- 1 | model = $accessarea; 42 | } 43 | 44 | /** 45 | * Get the channels the event should broadcast on. 46 | * 47 | * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[] 48 | */ 49 | public function broadcastOn() 50 | { 51 | return [ 52 | new PrivateChannel('cortex.foundation.accessareas.index'), 53 | new PrivateChannel("cortex.foundation.accessareas.{$this->model->getRouteKey()}"), 54 | ]; 55 | } 56 | 57 | /** 58 | * The event's broadcast name. 59 | * 60 | * @return string 61 | */ 62 | public function broadcastAs() 63 | { 64 | return 'accessarea.restored'; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/Events/AccessareaUpdated.php: -------------------------------------------------------------------------------- 1 | model = $accessarea; 42 | } 43 | 44 | /** 45 | * Get the channels the event should broadcast on. 46 | * 47 | * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[] 48 | */ 49 | public function broadcastOn() 50 | { 51 | return [ 52 | new PrivateChannel('cortex.foundation.accessareas.index'), 53 | new PrivateChannel("cortex.foundation.accessareas.{$this->model->getRouteKey()}"), 54 | ]; 55 | } 56 | 57 | /** 58 | * The event's broadcast name. 59 | * 60 | * @return string 61 | */ 62 | public function broadcastAs() 63 | { 64 | return 'accessarea.updated'; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/Exceptions/GenericException.php: -------------------------------------------------------------------------------- 1 | inputs = $inputs; 45 | $this->statusCode = $statusCode; 46 | $this->redirection = $redirection; 47 | } 48 | 49 | /** 50 | * Get the HTTP status code. 51 | * 52 | * @return int 53 | */ 54 | public function getStatusCode() 55 | { 56 | return $this->statusCode; 57 | } 58 | 59 | /** 60 | * Gets the Exception redirection. 61 | * 62 | * @return string 63 | */ 64 | final public function getRedirection() 65 | { 66 | return $this->redirection; 67 | } 68 | 69 | /** 70 | * Gets the Exception inputs. 71 | * 72 | * @return array 73 | */ 74 | final public function getInputs() 75 | { 76 | return $this->inputs; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/Exceptions/ProtectedResourceException.php: -------------------------------------------------------------------------------- 1 | model->getMorphClass())).'/'.$media->collection_name.'/'.$media->getRouteKey(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Http/Controllers/Absentarea/HomeController.php: -------------------------------------------------------------------------------- 1 | accessarea(), config('cortex.auth.guardians'))) { 33 | $this->middleware('auth.basic:guardian,username'); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Http/Controllers/Adminarea/GenericController.php: -------------------------------------------------------------------------------- 1 | getClientIp())->iso_code; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Http/Controllers/Adminarea/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware(($guard = request()->guard()) ? 'auth:'.$guard : 'auth')->except($this->middlewareWhitelist); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Http/Controllers/Centralarea/HomeController.php: -------------------------------------------------------------------------------- 1 | getClientIp())->iso_code; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Http/Controllers/Frontarea/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware(($guard = request()->guard()) ? 'guest:'.$guard : 'guest')->except($this->middlewareWhitelist); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | disabledGlobalMiddleware = $this->middleware; 26 | 27 | $this->middleware = []; 28 | } 29 | 30 | /** 31 | * Enable global middleware. 32 | * 33 | * @return void 34 | */ 35 | public function enableGlobalMiddleware(): void 36 | { 37 | $this->middleware = $this->disabledGlobalMiddleware; 38 | 39 | $this->disabledGlobalMiddleware = []; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Http/Middleware/Clockwork.php: -------------------------------------------------------------------------------- 1 | app = $app; 30 | } 31 | 32 | /** 33 | * Handle an incoming request. 34 | * 35 | * @param \Illuminate\Http\Request $request 36 | * @param \Closure $next 37 | * 38 | * @throws \Throwable 39 | * 40 | * @return mixed 41 | */ 42 | public function handle($request, Closure $next) 43 | { 44 | $this->app['clockwork']->event('Controller')->begin(); 45 | 46 | try { 47 | $response = $next($request); 48 | } catch (\Exception $e) { 49 | $this->app[ExceptionHandler::class]->report($e); 50 | $response = $this->app[ExceptionHandler::class]->render($request, $e); 51 | } 52 | 53 | return $this->app['clockwork.support']->processRequest($request, $response); 54 | } 55 | 56 | /** 57 | * Record the current request after a response is sent. 58 | * 59 | * @return void 60 | */ 61 | public function terminate() 62 | { 63 | $this->app['clockwork.support']->recordRequest(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Http/Middleware/DiscoverNavigationRoutes.php: -------------------------------------------------------------------------------- 1 | accessarea()) && app('accessareas')->contains('slug', $accessarea)) { 23 | foreach (['module', 'extension'] as $moduleType) { 24 | $resources = app('files')->{"{$moduleType}Resources"}(["routes/menus/{$accessarea}.php", "routes/breadcrumbs/{$accessarea}.php"], 'files', '2'); 25 | 26 | collect($resources) 27 | ->prioritizeLoading() 28 | ->each(fn (SplFileInfo $file) => require $file->getPathname()); 29 | } 30 | } 31 | 32 | return $next($request); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Http/Middleware/EnforceTrailingSlash.php: -------------------------------------------------------------------------------- 1 | ajax() && config('cortex.foundation.route.trailing_slash')) { 23 | $requestUri = $request->getRequestUri(); 24 | $queryString = $request->getQueryString(); 25 | $untrimmedPath = trim($request->getPathInfo(), '/').'/'; 26 | 27 | if ($request->method() === 'GET' && mb_strrchr($requestUri, '.') === false && $this->checkQueryString($requestUri, $queryString)) { 28 | return redirect()->to($untrimmedPath.(! empty($queryString) ? '?'.$queryString : ''), 301); 29 | } 30 | } 31 | 32 | return $next($request); 33 | } 34 | 35 | /** 36 | * @param $requestUri 37 | * @param $queryString 38 | * 39 | * @return bool 40 | */ 41 | protected function checkQueryString($requestUri, $queryString): bool 42 | { 43 | return (! $queryString && ! Str::endsWith($requestUri, '/')) || ($queryString && ! Str::endsWith(mb_strstr($requestUri, '?', true), '/')); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Http/Middleware/LocalizationRedirect.php: -------------------------------------------------------------------------------- 1 | instanceof NotFoundHttpException 20 | */ 21 | class LocalizationRedirect extends LaravelLocalizationMiddlewareBase 22 | { 23 | /** 24 | * Handle an incoming request. 25 | * 26 | * @param \Illuminate\Http\Request $request 27 | * @param \Closure $next 28 | * 29 | * @return mixed 30 | */ 31 | public function handle($request, Closure $next) 32 | { 33 | // If the URL of the request is in exceptions. 34 | if ($this->shouldIgnore($request)) { 35 | return $next($request); 36 | } 37 | 38 | $urlLocale = $request->route('locale'); 39 | $sessionLocale = session('locale', app('laravellocalization')->getCurrentLocale()); 40 | 41 | // {locale} exists in URL & supported 42 | if (app('laravellocalization')->checkLocaleInSupportedLocales($urlLocale)) { 43 | session(['locale' => $urlLocale]); 44 | 45 | return $next($request); 46 | } 47 | 48 | // {locale} exists in URL & NOT supported, get {locale} 49 | // from session or get default if session does not exist too 50 | if ($urlLocale && (app('laravellocalization')->checkLocaleInSupportedLocales($sessionLocale) || $sessionLocale = app('laravellocalization')->getCurrentLocale())) { 51 | $url = route($request->route()->getName(), ['locale' => $sessionLocale]); 52 | session(['locale' => $sessionLocale]); 53 | app('session')->reflash(); 54 | 55 | return new RedirectResponse($url, 302, ['Vary' => 'Accept-Language']); 56 | } 57 | 58 | return $next($request); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Http/Middleware/NotificationMiddleware.php: -------------------------------------------------------------------------------- 1 | session->get($this->key, []); 24 | 25 | if (count($containers) > 0) { 26 | foreach ($containers as $name => $messages) { 27 | /** @var \Krucas\Notification\Message $message */ 28 | foreach ($messages as $message) { 29 | $this->notification->container($name)->add($message->getType(), strip_tags($message), false); 30 | } 31 | } 32 | } 33 | 34 | foreach (config('notification.default_types') as $type) { 35 | if ($request->session()->has($type)) { 36 | $message = $request->session()->get($type); 37 | 38 | if ($message instanceof ViewErrorBag) { 39 | foreach ($message->messages() as $key => $values) { 40 | $message = $values[0]; 41 | } 42 | } 43 | 44 | $this->notification->container(null)->add($type, strip_tags($message), false); 45 | } 46 | } 47 | 48 | $this->session->forget($this->key); 49 | 50 | return $next($request); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | response = $next($request); 28 | $shouldIndex = $this->shouldIndex($request); 29 | 30 | if (is_bool($shouldIndex)) { 31 | return $this->responseWithRobots($shouldIndex ? 'all' : 'none'); 32 | } 33 | 34 | if (is_string($shouldIndex)) { 35 | return $this->responseWithRobots($shouldIndex); 36 | } 37 | 38 | throw new Exception(trans('cortex/foundation::messages.invalid_indexing_rule')); 39 | } 40 | 41 | /** 42 | * Response with robots. 43 | * 44 | * @param string $contents 45 | * 46 | * @return mixed 47 | */ 48 | protected function responseWithRobots(string $contents) 49 | { 50 | $this->response->headers->set('x-robots-tag', $contents, false); 51 | 52 | return $this->response; 53 | } 54 | 55 | /** 56 | * @return string|bool 57 | */ 58 | protected function shouldIndex(Request $request) 59 | { 60 | return app()->environment('production') && app('accessareas')->where('is_indexable', true)->contains('slug', $request->accessarea()); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/Http/Middleware/SetNoCacheHeaders.php: -------------------------------------------------------------------------------- 1 | headers->set('Pragma', 'no-cache'); 35 | $response->headers->set('Expires', 'Sat, 01-Jan-2000 00:00:00 GMT'); 36 | $response->headers->set('Cache-Control', 'private, no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0'); 37 | 38 | return $response; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Http/Middleware/SetSessionConfigRuntime.php: -------------------------------------------------------------------------------- 1 | accessarea()) { 24 | $domain = $request->getHost(); 25 | $scheme = $request->getScheme(); 26 | 27 | config()->set('app.url', $scheme.'://'.$domain); 28 | 29 | // Dynamically change session domain config on the fly. 30 | // This method enforces session isolation between domains (including subdomains). 31 | // That means users who are signed in any subdomain or top level domain, will not be signed in other domains. 32 | if (array_key_exists($domain, config('app.domains')) || Str::endsWith($domain, array_keys(config('app.domains'))) || (app('request.tenant') && app('request.tenant')->domain === $domain)) { 33 | config()->set('session.domain', '.'.$domain); 34 | } 35 | 36 | // @TODO: we need add support for selective domain session sharing (with cross-domain cookie sharing as well) 37 | // The reason is for tenants who are using multiple domains like cortex.rinvex.test and cortex.test, once 38 | // their users signin any of their domains, they should be signed in all, and vice-versa with signout. 39 | 40 | $session = config('session'); 41 | Cookie::setDefaultPathAndDomain( 42 | $session['path'], 43 | $session['domain'], 44 | $session['secure'], 45 | $session['same_site'] ?? null 46 | ); 47 | } 48 | 49 | return $next($request); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | ajax() && $request->method() === 'GET' && config('cortex.foundation.route.trim_www') && mb_substr($request->header('host'), 0, 4) === 'www.') { 22 | $request->headers->set('host', mb_substr($request->header('host'), 4)); 23 | 24 | return redirect()->to($request->fullUrl(), 301); 25 | } 26 | 27 | return $next($request); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | accessarea()); 20 | 21 | foreach ($domains as $domain) { 22 | $hosts[] = '^(.+\.)?'.preg_quote($domain).'$'; 23 | } 24 | 25 | return $hosts; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | route()->forgetParameter('locale'); 23 | 24 | // unBind route domain parameters. Ex: {frontarea}, {adminarea} ..etc 25 | app('accessareas')->each(function ($accessarea) use ($request) { 26 | $request->route()->forgetParameter($accessarea->slug); 27 | }); 28 | 29 | return $next($request); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | route('accessarea') ?? app('cortex.foundation.accessarea'); 32 | $accessarea->updateRulesUniques(); 33 | 34 | return $accessarea->getRules(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Http/Requests/ImageFormRequest.php: -------------------------------------------------------------------------------- 1 | 'required|mimetypes:'.$mediaMimetypes.'|max:'.$mediaSize, 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Http/Requests/ImportFormRequest.php: -------------------------------------------------------------------------------- 1 | 'required|file|mimetypes:'.implode(',', config('cortex.foundation.datatables.imports')), 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Importers/InsertImporter.php: -------------------------------------------------------------------------------- 1 | model->create($row); 32 | } 33 | 34 | public function chunkSize(): int 35 | { 36 | return $this->chunkSize ?: config('cortex.foundation.datatables.chunk_size'); 37 | } 38 | 39 | public function batchSize(): int 40 | { 41 | return $this->batchSize ?: config('cortex.foundation.datatables.batch_size'); 42 | } 43 | 44 | public function withModel(Model $resource) 45 | { 46 | $this->model = $resource; 47 | 48 | return $this; 49 | } 50 | 51 | public function withChunk(int $chunkSize) 52 | { 53 | $this->chunkSize = $chunkSize; 54 | 55 | return $this; 56 | } 57 | 58 | public function withBatch(int $batchSize) 59 | { 60 | $this->batchSize = $batchSize; 61 | 62 | return $this; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Loaders/FileLoader.php: -------------------------------------------------------------------------------- 1 | hints[$namespace])) { 23 | $lines = $this->loadPaths((array) $this->hints[$namespace], $locale, $group); 24 | 25 | return $this->loadNamespaceOverrides($lines, $locale, $group, $namespace); 26 | } 27 | 28 | return []; 29 | } 30 | 31 | /** 32 | * Add a new namespace to the loader. 33 | * 34 | * @param string $namespace 35 | * @param string|array $hint 36 | * 37 | * @return void 38 | */ 39 | public function addNamespace($namespace, $hint) 40 | { 41 | $hint = (array) $hint; 42 | 43 | if (isset($this->hints[$namespace])) { 44 | $hint = array_merge($this->hints[$namespace], $hint); 45 | } 46 | 47 | $this->hints[$namespace] = $hint; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Models/AbstractModel.php: -------------------------------------------------------------------------------- 1 | mergeConfigFrom($this->app->basePath('/vendor/appstract/laravel-opcache/config/opcache.php'), 'opcache'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Overrides/Barryvdh/Debugbar/DebugbarServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->basePath('vendor/barryvdh/laravel-debugbar/config/debugbar.php'); 21 | $this->publishes([$configPath => $this->getConfigPath()], 'config'); 22 | 23 | // @TODO: refactor routes 24 | $routeConfig = [ 25 | 'namespace' => 'Barryvdh\Debugbar\Controllers', 26 | 'prefix' => $this->app['config']->get('debugbar.route_prefix'), 27 | 'domain' => $this->app['config']->get('debugbar.route_domain'), 28 | 'middleware' => [DebugbarEnabled::class], 29 | ]; 30 | 31 | $this->getRouter()->group($routeConfig, function ($router) { 32 | $router->get('open', [ 33 | 'uses' => 'OpenHandlerController@handle', 34 | 'as' => 'debugbar.openhandler', 35 | ]); 36 | 37 | $router->get('clockwork/{id}', [ 38 | 'uses' => 'OpenHandlerController@clockwork', 39 | 'as' => 'debugbar.clockwork', 40 | ]); 41 | 42 | $router->get('telescope/{id}', [ 43 | 'uses' => 'TelescopeController@show', 44 | 'as' => 'debugbar.telescope', 45 | ]); 46 | 47 | $router->get('assets/stylesheets', [ 48 | 'uses' => 'AssetController@css', 49 | 'as' => 'debugbar.assets.css', 50 | ]); 51 | 52 | $router->get('assets/javascript', [ 53 | 'uses' => 'AssetController@js', 54 | 'as' => 'debugbar.assets.js', 55 | ]); 56 | 57 | $router->delete('cache/{key}/{tags?}', [ 58 | 'uses' => 'CacheController@delete', 59 | 'as' => 'debugbar.cache.delete', 60 | ]); 61 | }); 62 | 63 | $this->registerMiddleware(InjectDebugbar::class); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Overrides/Illuminate/Foundation/Events/DiscoverEvents.php: -------------------------------------------------------------------------------- 1 | basePath('app'), '', $file->getRealPath()), DIRECTORY_SEPARATOR); 24 | 25 | return str_replace( 26 | [DIRECTORY_SEPARATOR, '\Src'], 27 | ['\\', ''], 28 | ucwords(Str::replaceLast('.php', '', $class), " \t\r\n\f\v/") 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Overrides/Illuminate/Routing/RouteUrlGenerator.php: -------------------------------------------------------------------------------- 1 | getRouteQueryString($parameters); 29 | 30 | return is_null($fragment) ? $uri : $uri."#{$fragment}"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Overrides/Illuminate/Session/DatabaseSessionHandler.php: -------------------------------------------------------------------------------- 1 | container->has(Guard::class)) { 18 | $payload['user_id'] = $this->userId(); 19 | $payload['user_type'] = ($user = $this->container->make(Guard::class)->user()) ? $user->getMorphClass() : null; 20 | } 21 | 22 | return $this; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Overrides/Illuminate/Session/EncryptedStore.php: -------------------------------------------------------------------------------- 1 | encrypter = $encrypter; 34 | 35 | parent::__construct($name, $handler, $id, $serialization); 36 | } 37 | 38 | /** 39 | * Prepare the raw string data from the session for unserialization. 40 | * 41 | * @param string $data 42 | * 43 | * @return string 44 | */ 45 | protected function prepareForUnserialize($data) 46 | { 47 | try { 48 | return $this->encrypter->decrypt($data); 49 | } catch (DecryptException) { 50 | return $this->serialization === 'json' ? json_encode([]) : serialize([]); 51 | } 52 | } 53 | 54 | /** 55 | * Prepare the serialized session data for storage. 56 | * 57 | * @param string $data 58 | * 59 | * @return string 60 | */ 61 | protected function prepareForStorage($data) 62 | { 63 | return $this->encrypter->encrypt($data); 64 | } 65 | 66 | /** 67 | * Get the encrypter instance. 68 | * 69 | * @return \Illuminate\Contracts\Encryption\Encrypter 70 | */ 71 | public function getEncrypter() 72 | { 73 | return $this->encrypter; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/Overrides/Illuminate/Session/SessionManager.php: -------------------------------------------------------------------------------- 1 | has('request.tenant') && $tenant = app('request.tenant')) { 21 | $this->config->set('session.cookie', $tenant->slug.'_session'); 22 | } 23 | 24 | return $this->config->get('session.encrypt') 25 | ? $this->buildEncryptedSession($handler) 26 | : new Store($this->config->get('session.cookie'), $handler); 27 | } 28 | 29 | /** 30 | * Build the encrypted session instance. 31 | * 32 | * @param \SessionHandlerInterface $handler 33 | * 34 | * @return \Cortex\Foundation\Overrides\Illuminate\Session\EncryptedStore 35 | */ 36 | protected function buildEncryptedSession($handler) 37 | { 38 | return new EncryptedStore( 39 | $this->config->get('session.cookie'), 40 | $handler, 41 | $this->container['encrypter'] 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Overrides/Lord/Laroute/Console/Commands/LarouteGeneratorCommand.php: -------------------------------------------------------------------------------- 1 | line(''); 21 | 22 | try { 23 | $filePath = $this->generator->compile( 24 | $this->getTemplatePath(), 25 | $this->getTemplateData(), 26 | $this->getFileGenerationPath() 27 | ); 28 | 29 | $this->info("Created: {$filePath}"); 30 | } catch (\Exception $e) { 31 | $this->error($e->getMessage()); 32 | } 33 | $this->line(''); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Overrides/Lord/Laroute/LarouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->singleton( 21 | 'command.laroute.generate', 22 | function ($app) { 23 | $config = $app['config']; 24 | $routes = new Collection($app['router']->getRoutes(), $config->get('laroute.filter', 'all'), $config->get('laroute.action_namespace', '')); 25 | $generator = $app->make('Lord\Laroute\Generators\GeneratorInterface'); 26 | 27 | return new LarouteGeneratorCommand($config, $routes, $generator); 28 | } 29 | ); 30 | 31 | $this->commands('command.laroute.generate'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Overrides/Mariuzzo/LaravelJsLocalization/Commands/LangJsCommand.php: -------------------------------------------------------------------------------- 1 | line(''); 19 | $target = $this->argument('target'); 20 | $options = [ 21 | 'compress' => $this->option('compress'), 22 | 'json' => $this->option('json'), 23 | 'no-lib' => $this->option('no-lib'), 24 | 'source' => $this->option('source'), 25 | 'no-sort' => $this->option('no-sort'), 26 | ]; 27 | 28 | if ($this->generator->generate($target, $options)) { 29 | $this->info("Created: {$target}"); 30 | $this->line(''); 31 | 32 | return; 33 | } 34 | 35 | $this->error("Could not create: {$target}"); 36 | $this->line(''); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Overrides/Mcamara/LaravelLocalization/LaravelLocalization.php: -------------------------------------------------------------------------------- 1 | configRepository->get('app.locale'), 20 | $this->configRepository->get('app.fallback_locale'), 21 | ]); 22 | } 23 | 24 | /** 25 | * Build URL using array data from parse_url. 26 | * 27 | * @param array|false $parsed_url Array of data from parse_url function 28 | * 29 | * @return string Returns URL as string. 30 | */ 31 | protected function unparseUrl($parsed_url) 32 | { 33 | if (empty($parsed_url)) { 34 | return ''; 35 | } 36 | 37 | $url = ''; 38 | $url .= isset($parsed_url['scheme']) ? $parsed_url['scheme'].'://' : ''; 39 | $url .= $parsed_url['host'] ?? ''; 40 | $url .= isset($parsed_url['port']) ? ':'.$parsed_url['port'] : ''; 41 | $user = $parsed_url['user'] ?? ''; 42 | $pass = isset($parsed_url['pass']) ? ':'.$parsed_url['pass'] : ''; 43 | $url .= $user.(($user || $pass) ? "{$pass}@" : ''); 44 | 45 | if (! empty($url)) { 46 | $url .= isset($parsed_url['path']) ? '/'.ltrim($parsed_url['path'], '/').(config('cortex.foundation.route.trailing_slash') ? '/' : '') : ''; 47 | } else { 48 | $url .= isset($parsed_url['path']) ? $parsed_url['path'].(config('cortex.foundation.route.trailing_slash') ? '/' : '') : ''; 49 | } 50 | 51 | $url .= isset($parsed_url['query']) ? '?'.$parsed_url['query'] : ''; 52 | $url .= isset($parsed_url['fragment']) ? '#'.$parsed_url['fragment'] : ''; 53 | 54 | return $url; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Providers/ConsoleSupportServiceProvider.php: -------------------------------------------------------------------------------- 1 | registerSessionManager(); 22 | 23 | $this->registerSessionDriver(); 24 | 25 | $this->app->singleton(StartSession::class, function ($app) { 26 | return new StartSession($app->make(SessionManager::class), function () use ($app) { 27 | return $app->make(CacheFactory::class); 28 | }); 29 | }); 30 | 31 | // Override `Illuminate\Foundation\Application::registerCoreContainerAliases`, otherwise sessions are screwed! 32 | $this->app->alias('session', \Cortex\Foundation\Overrides\Illuminate\Session\SessionManager::class); 33 | } 34 | 35 | /** 36 | * Register the session manager instance. 37 | * 38 | * @return void 39 | */ 40 | protected function registerSessionManager() 41 | { 42 | $this->app->singleton('session', function ($app) { 43 | return new SessionManager($app); 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Providers/TranslationServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->singleton('translation.loader', function ($app) { 20 | return new FileLoader($app['files'], [$app['path.lang']]); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Transformers/AccessareaTransformer.php: -------------------------------------------------------------------------------- 1 | escape([ 27 | 'id' => (string) $accessarea->getRouteKey(), 28 | 'name' => (string) $accessarea->name, 29 | 'is_active' => (bool) $accessarea->is_active, 30 | 'is_obscured' => (bool) $accessarea->is_obscured, 31 | 'created_at' => (string) $accessarea->created_at, 32 | 'updated_at' => (string) $accessarea->updated_at, 33 | ]); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Transformers/ActivityTransformer.php: -------------------------------------------------------------------------------- 1 | subject_type; 27 | $subjects = Str::plural($subject); 28 | // @TODO: identify the new route name. ex: adminarea.cortex.auth.roles.edit 29 | $route = Route::has("adminarea.{$subjects}.edit") ? route("adminarea.{$subjects}.edit", [$subject => $log->subject]) : null; 30 | 31 | if ($log->subject) { 32 | $subjectName = ucfirst($subject).': '.($log->subject->username ?? $log->subject->name ?? $log->subject->name); 33 | } else { 34 | $subjectName = ucfirst($subject).': Not Found!'; 35 | } 36 | 37 | return $this->escape([ 38 | 'id' => (int) $log->getKey(), 39 | 'description' => (string) $log->description, 40 | 'subject' => $subjectName, 41 | 'subject_route' => $route, 42 | 'properties' => (object) $log->properties, 43 | 'created_at' => (string) $log->created_at, 44 | ]); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Transformers/DataArrayTransformer.php: -------------------------------------------------------------------------------- 1 | get('visible_columnss', []); 28 | 29 | foreach ($columns->all() as $column) { 30 | if ($column[$type] && (! $visibleCOlumns || in_array($column['name'], $visibleCOlumns))) { 31 | $title = $column['name']; 32 | $data = Arr::get($row, $column['data']); 33 | 34 | if ($type === 'exportable') { 35 | $title = $this->decodeContent($title); 36 | $dataType = gettype($data); 37 | $data = $this->decodeContent($data); 38 | settype($data, $dataType); 39 | } 40 | 41 | $results[$title] = $data; 42 | } 43 | } 44 | 45 | return $results; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Transformers/LogTransformer.php: -------------------------------------------------------------------------------- 1 | causer) { 29 | $class = explode('\\', get_class($log->causer)); 30 | $singleResource = Str::lower(end($class)); 31 | $pluralResource = Str::plural(Str::lower(end($class))); 32 | $causer = ucfirst($singleResource).': '.($log->causer->username ?? $log->causer->name ?? $log->causer->slug); 33 | // @TODO: identify the new route name. ex: adminarea.cortex.auth.members.edit 34 | $causer_route = Route::has("adminarea.{$pluralResource}.edit") ? route("adminarea.{$pluralResource}.edit", [$singleResource => $log->causer]) : null; 35 | } else { 36 | $causer = 'System'; 37 | } 38 | 39 | return $this->escape([ 40 | 'id' => (int) $log->getKey(), 41 | 'description' => (string) $log->description, 42 | 'causer' => $causer, 43 | 'causer_route' => $causer_route, 44 | 'properties' => (object) $log->properties, 45 | 'created_at' => (string) $log->created_at, 46 | ]); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Transformers/MediaTransformer.php: -------------------------------------------------------------------------------- 1 | escape([ 21 | 'id' => (int) $media->getKey(), 22 | 'name' => (string) $media->name, 23 | 'file_name' => (string) $media->file_name, 24 | 'mime_type' => (string) $media->mime_type, 25 | 'size' => (string) $media->getHumanReadableSizeAttribute(), 26 | 'created_at' => (string) $media->created_at, 27 | 'updated_at' => (string) $media->updated_at, 28 | 'delete' => (string) route('adminarea.rooms.media.destroy', ['room' => $media->model, 'media' => $media]), 29 | ]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Validators/Validator.php: -------------------------------------------------------------------------------- 1 | getTable(); 32 | $connection ??= $model->getConnectionName(); 33 | 34 | if (str_contains($table, '.') && Str::startsWith($table, $connection)) { 35 | $connection = null; 36 | } 37 | 38 | $idColumn = $model->getKeyName(); 39 | } 40 | 41 | return [$connection, $this->getValidationModel($model ?? null, $table), $idColumn ?? null]; 42 | } 43 | 44 | /** 45 | * Return the model instance to be used in validation. 46 | * 47 | * @param \Illuminate\Database\Eloquent\Model|null $model 48 | * @param $table string 49 | * 50 | * @return \Illuminate\Database\Eloquent\Model 51 | */ 52 | protected function getValidationModel(?Model $model, string $table): Model 53 | { 54 | return $model ? ($this->isValidationScoped($model) ? $model : $model->withoutGlobalScopes()) : (new AbstractModel())->setTable($table); 55 | } 56 | 57 | /** 58 | * Returns whether the model validation be scoped or not. (Default: true). 59 | * 60 | * @param \Illuminate\Database\Eloquent\Model $model 61 | * 62 | * @return bool 63 | */ 64 | protected function isValidationScoped(Model $model): bool 65 | { 66 | return $model->isValidationScoped ?? true; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/Verifiers/EloquentPresenceVerifier.php: -------------------------------------------------------------------------------- 1 | model($model)->where($column, '=', $value); 26 | 27 | if (! is_null($excludeId) && $excludeId !== 'NULL') { 28 | $query->where($idColumn ?: 'id', '<>', $excludeId); 29 | } 30 | 31 | return $this->addConditions($query, $extra)->count(); 32 | } 33 | 34 | /** 35 | * Count the number of objects in a collection with the given values. 36 | * 37 | * @param string $model 38 | * @param string $column 39 | * @param array $values 40 | * @param array $extra 41 | * 42 | * @return int 43 | */ 44 | public function getMultiCount($model, $column, array $values, array $extra = []) 45 | { 46 | $query = $this->model($model)->whereIn($column, $values); 47 | 48 | return $this->addConditions($query, $extra)->distinct()->count($column); 49 | } 50 | 51 | /** 52 | * Get model eloquent builder. 53 | * 54 | * @param $model 55 | * 56 | * @return \Illuminate\Database\Eloquent\Builder 57 | */ 58 | private function model($model) 59 | { 60 | return $model->setConnection($this->connection)->useWritePdo(); 61 | } 62 | } 63 | --------------------------------------------------------------------------------