diff --git a/.editorconfig b/.editorconfig index d2f7d1fc4..12fe9749f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,3 +19,6 @@ indent_size = 4 [*.blade.php] indent_size = 4 + +[*.stub] +indent_size = 4 diff --git a/config/frontend.php b/config/frontend.php index 8f41276db..9e696f318 100644 --- a/config/frontend.php +++ b/config/frontend.php @@ -12,10 +12,10 @@ | */ 'rev_manifest_path' => public_path('dist/rev-manifest.json'), - 'dev_assets_path' => '/dev', + 'dev_assets_path' => '/dist', // you can use another path for dev to avoid having to recompile after a deploy that compiles assets locally 'dist_assets_path' => '/dist', 'svg_sprites_path' => 'sprites.svg', // relative to dev/dist assets paths 'svg_sprites_use_hash_only' => true, - 'views_path' => 'front', + 'views_path' => 'site', 'home_route_name' => 'home', ]; diff --git a/config/laravel-env-validator.php b/config/laravel-env-validator.php deleted file mode 100644 index 6a264abb2..000000000 --- a/config/laravel-env-validator.php +++ /dev/null @@ -1,18 +0,0 @@ - 'required|in:local,development,staging,production', - // 'APP_KEY' => 'required', - // 'DB_DATABASE' => 'required', - // 'DB_USERNAME' => 'required', - // 'S3_KEY' => 'required', - // 'S3_SECRET' => 'required', - // 'S3_BUCKET' => 'required', - // 'IMGIX_SOURCE_HOST' => 'required', - // 'IMGIX_SIGN_KEY' => 'required_if:IMGIX_USE_SIGNED_URLS,true', - // 'SEO_IMAGE_DEFAULT_ID' => 'required_if:APP_ENV,production', - // 'SEO_IMAGE_LOCAL_FALLBACK' => 'required_if:APP_ENV,production', - // 'ROLLBAR_TOKEN' => 'required_if:APP_ENV,production', - // 'ROLLBAR_LEVEL' => 'required_if:APP_ENV,production', - // 'GOOGLE_ANALYTICS_KEY' => 'required_if:APP_ENV,production', -]; diff --git a/src/CmsToolkitServiceProvider.php b/src/CmsToolkitServiceProvider.php index 7d4c56a7a..b79627f6a 100644 --- a/src/CmsToolkitServiceProvider.php +++ b/src/CmsToolkitServiceProvider.php @@ -6,7 +6,6 @@ use A17\CmsToolkit\Commands\ModuleMake; use A17\CmsToolkit\Commands\RefreshLQIP; use A17\CmsToolkit\Commands\Setup; -use A17\CmsToolkit\Commands\UpdateCmsAssets; use A17\CmsToolkit\Helpers\FlashNotifier; use A17\CmsToolkit\Http\ViewComposers\ActiveNavigation; use A17\CmsToolkit\Http\ViewComposers\CurrentUser; @@ -32,7 +31,6 @@ use Lsrur\Inspector\InspectorServiceProvider; use MathiasGrimm\LaravelEnvValidator\ServiceProvider as EnvValidatorServiceProvider; use Sofa\ModelLocking\ServiceProvider as ModelLockingServiceProvider; - use View; class CmsToolkitServiceProvider extends ServiceProvider @@ -46,7 +44,7 @@ class CmsToolkitServiceProvider extends ServiceProvider FlashServiceProvider::class, TagsServiceProvider::class, EnvValidatorServiceProvider::class, - ModelLockingServiceProvider::class + ModelLockingServiceProvider::class, ]; protected $aliases = [ @@ -154,8 +152,6 @@ private function publishConfigs() private function mergeConfigs() { $this->mergeConfigFrom(__DIR__ . '/../config/cms-toolkit.php', 'cms-toolkit'); - $this->mergeConfigFrom(__DIR__ . '/../config/services.php', 'services'); - $this->mergeConfigFrom(__DIR__ . '/../config/laravel-env-validator.php', 'laravel-env-validator'); $this->mergeConfigFrom(__DIR__ . '/../config/disks.php', 'filesystems.disks'); $this->mergeConfigFrom(__DIR__ . '/../config/frontend.php', 'cms-toolkit.frontend'); $this->mergeConfigFrom(__DIR__ . '/../config/debug.php', 'cms-toolkit.debug'); @@ -165,7 +161,6 @@ private function mergeConfigs() $this->mergeConfigFrom(__DIR__ . '/../config/imgix.php', 'cms-toolkit.imgix'); $this->mergeConfigFrom(__DIR__ . '/../config/media-library.php', 'cms-toolkit.media_library'); $this->mergeConfigFrom(__DIR__ . '/../config/file-library.php', 'cms-toolkit.file_library'); - $this->mergeConfigFrom(__DIR__ . '/../config/imgix.php', 'cms-toolkit.imgix'); } private function publishMigrations() @@ -176,7 +171,7 @@ private function publishMigrations() 'CreateUsersTables' => 'users-management', 'CreateFilesTables' => 'file-library', 'CreateMediasTables' => 'media-library', - 'CreateFeaturesTable' => 'buckets' + 'CreateFeaturesTable' => 'buckets', ]; if ($this->app->runningInConsole()) { @@ -215,7 +210,6 @@ private function registerCommands() if ($this->app->runningInConsole()) { $this->commands([ Setup::class, - UpdateCmsAssets::class, ModuleMake::class, CreateSuperAdmin::class, RefreshLQIP::class, diff --git a/src/Commands/UpdateCmsAssets.php b/src/Commands/UpdateCmsAssets.php deleted file mode 100644 index 935919790..000000000 --- a/src/Commands/UpdateCmsAssets.php +++ /dev/null @@ -1,41 +0,0 @@ -call('vendor:publish', [ - '--provider' => "A17\CmsToolkit\CmsToolkitServiceProvider", - '--tag' => "assets", - '--force' => true, - ]); - - if ($this->option('latest')) { - $this->updateCmsAssetsFromLatest(); - } - } - - private function updateCmsAssetsFromLatest() - { - $assetsPath = public_path('assets/admin'); - - if (!File::exists($assetsPath)) { - File::makeDirectory($assetsPath, 0755, true); - } - - $assets = ['a17cms.css', 'a17cms.js']; - - collect($assets)->each(function ($asset) use ($assetsPath) { - File::put($assetsPath . '/' . $asset, file_get_contents('http://' . config('services.cms.credentials') . '@cms3.dev.area17.com/latest/' . $asset)); - }); - } -} diff --git a/src/Commands/stubs/form.blade.stub b/src/Commands/stubs/form.blade.stub index 3211b6691..e69de29bb 100644 --- a/src/Commands/stubs/form.blade.stub +++ b/src/Commands/stubs/form.blade.stub @@ -1,52 +0,0 @@ -{{-- - -@extends('cms-toolkit::layouts.resources.form') - -@section('form') - {{ Form::model($form_fields, $form_options) }} - @formField('publish_status') -
-
-

{{ $form_fields['title'] or 'New item' }}

-
- @formField('input', [ - 'field' => 'title', - 'field_name' => 'Title', - ]) - @formField('textarea', [ - 'field' => 'embed_video', - 'field_name' => 'Code' - ]) - @formField('rich_textarea', [ - 'field' => 'description', - 'field_name' => 'Description' - ]) - @formField('date_picker', [ - 'fieldname' => "Publish start date", - 'field' => "publish_start_date", - ]) - @formField('select', [ - 'field' => "relationship_id", - 'field_name' => "Relationship", - 'list' => $relationshipList, - 'data_behavior' => 'selector', - 'placeholder' => 'Select a relationship' - ]) - @formField('multi_select', [ - 'field' => "relationship", - 'field_name' => 'Related relationship', - 'list' => $relationshipList, - 'placeholder' => 'Add some relationship', - 'maximumSelectionLength' => 5 - ]) - @formField('checkbox', [ - 'field' => 'boolean', - 'field_name' => 'Boolean?' - ]) -
- @formField('medias', ['media_role' => 'media_role']) - @formField('files', ['file_role' => 'file role', 'file_role_name' => 'Role name']) - @formField('block_editor', ['field_name' => 'content']) -@stop - ---}} diff --git a/src/Commands/stubs/form_translatable.blade.stub b/src/Commands/stubs/form_translatable.blade.stub index 74383ef03..e69de29bb 100644 --- a/src/Commands/stubs/form_translatable.blade.stub +++ b/src/Commands/stubs/form_translatable.blade.stub @@ -1,55 +0,0 @@ -{{-- - -@extends('cms-toolkit::layouts.resources.form') - -@section('form') - {{ Form::model($form_fields, $form_options) }} - @formField('publish_status') -
-
-

{{ $form_fields['title'] or 'New item' }}

-
- @formField('input_locale', [ - 'field' => 'title', - 'field_name' => 'Title', - 'required' => 'required' - ]) - @formField('textarea_locale', [ - 'field' => 'description', - 'field_name' => 'Description', - 'textLimit' => 100, - 'required' => 'required' - ]) - @formField('rich_textarea_locale', [ - 'field' => 'description', - 'field_name' => 'Description' - ]) - @formField('date_picker', [ - 'fieldname' => "Publish start date", - 'field' => "publish_start_date", - ]) - @formField('select', [ - 'field' => "relationship_id", - 'field_name' => "Relationship", - 'list' => $relationshipList, - 'data_behavior' => 'selector', - 'placeholder' => 'Select a relationship' - ]) - @formField('multi_select', [ - 'field' => "relationship", - 'field_name' => 'Related relationship', - 'list' => $relationshipList, - 'placeholder' => 'Add some relationship', - 'maximumSelectionLength' => 5 - ]) - @formField('checkbox', [ - 'field' => 'boolean', - 'field_name' => 'Boolean?' - ]) -
- @formField('medias', ['media_role' => 'media_role']) - @formField('files', ['file_role' => 'file role', 'file_role_name' => 'Role name']) - @formField('block_editor', ['field_name' => 'content']) -@stop - ---}} diff --git a/src/Commands/stubs/index.blade.stub b/src/Commands/stubs/index.blade.stub index 3e9501dee..e69de29bb 100644 --- a/src/Commands/stubs/index.blade.stub +++ b/src/Commands/stubs/index.blade.stub @@ -1,40 +0,0 @@ -{{-- - -@extends('cms-toolkit::layouts.resources.index', [ - 'create' => true, - 'edit' => true, - 'delete' => true, - 'sort' => false, - 'search' => true, - 'publish' => true, - 'columns' => [ - 'image' => [ - 'title' => 'Image', - 'thumb' => true, - 'variant' => [ - 'role' => 'roleName', - 'crop' => 'cropName', - ], - ], - 'fieldName' => [ - 'title' => 'Field title', - 'edit_link' => true, - 'sort' => true, - 'field' => 'fieldName', - ], - 'relationName' => [ - 'title' => 'Relation name', - 'sort' => true, - 'sortField' => 'foreign_key', - 'relationship' => 'relationName', - 'field' => 'relationFieldToDisplay' - ], - 'presenterMethodField' => [ - 'title' => 'Field title', - 'field' => 'presenterMethod', - 'present' => true, - ] - ] -]) - ---}} diff --git a/src/Commands/stubs/repository.stub b/src/Commands/stubs/repository.stub index 4a492bb71..75afcd89b 100644 --- a/src/Commands/stubs/repository.stub +++ b/src/Commands/stubs/repository.stub @@ -14,72 +14,4 @@ class {{repositoryClassName}} extends ModuleRepository { $this->model = $model; } - - /** - * - * Custom filtering with helpers - * - * public function filter($query, array $scopes = []) - * { - * return parent::filter($query, $scopes); - * } - * - */ - - /** - * - * Custom ordering - * - * public function order($query, array $orders = []) - * { - * return parent::order($query, $orders); - * } - * - */ - - /** - * - * Custom form fields - * - * public function getFormFields($object) - * { - * $fields = parent::getFormFields($object); - * - * return $fields; - * } - * - */ - - /** - * - * Before create hook - * - * public function prepareFieldsBeforeCreate($fields) - * { - * return parent::prepareFieldsBeforeCreate($fields); - * } - * - */ - - /** - * - * Before save hook - * - * public function prepareFieldsBeforeSave($object, $fields) - * { - * return parent::prepareFieldsBeforeSave($object, $fields); - * } - * - */ - - /** - * - * After save hook - * - * public function afterSave($object, $fields) - * { - * parent::afterSave($object, $fields); - * } - * - */ } diff --git a/src/Helpers/model_helpers.php b/src/Helpers/model_helpers.php index c446c7ed7..d75aa2909 100644 --- a/src/Helpers/model_helpers.php +++ b/src/Helpers/model_helpers.php @@ -16,7 +16,7 @@ function classUsesDeep($class, $autoload = true) $newTraits = class_uses(array_pop($traitsToSearch), $autoload); $traits = array_merge($newTraits, $traits); $traitsToSearch = array_merge($newTraits, $traitsToSearch); - }; + } foreach ($traits as $trait => $same) { $traits = array_merge(class_uses($trait, $autoload), $traits); diff --git a/src/Http/Controllers/Admin/FeaturedController.php b/src/Http/Controllers/Admin/FeaturedController.php index 5cf308456..071a32807 100644 --- a/src/Http/Controllers/Admin/FeaturedController.php +++ b/src/Http/Controllers/Admin/FeaturedController.php @@ -162,7 +162,6 @@ private function getFeaturableItemsByBucketable($featuredSection, $search = null private function getRepository($bucketable) { - return app(config('cms-toolkit.namespace') . "\Repositories\\" . ucfirst(str_singular($bucketable)) . "Repository"); }