Skip to content

Commit

Permalink
WIP — Update config and stub
Browse files Browse the repository at this point in the history
  • Loading branch information
ifox committed Oct 30, 2017
1 parent 018ee3c commit df5912b
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 286 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ indent_size = 4

[*.blade.php]
indent_size = 4

[*.stub]
indent_size = 4
4 changes: 2 additions & 2 deletions config/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
18 changes: 0 additions & 18 deletions config/laravel-env-validator.php

This file was deleted.

10 changes: 2 additions & 8 deletions src/CmsToolkitServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -46,7 +44,7 @@ class CmsToolkitServiceProvider extends ServiceProvider
FlashServiceProvider::class,
TagsServiceProvider::class,
EnvValidatorServiceProvider::class,
ModelLockingServiceProvider::class
ModelLockingServiceProvider::class,
];

protected $aliases = [
Expand Down Expand Up @@ -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');
Expand All @@ -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()
Expand All @@ -176,7 +171,7 @@ private function publishMigrations()
'CreateUsersTables' => 'users-management',
'CreateFilesTables' => 'file-library',
'CreateMediasTables' => 'media-library',
'CreateFeaturesTable' => 'buckets'
'CreateFeaturesTable' => 'buckets',
];

if ($this->app->runningInConsole()) {
Expand Down Expand Up @@ -215,7 +210,6 @@ private function registerCommands()
if ($this->app->runningInConsole()) {
$this->commands([
Setup::class,
UpdateCmsAssets::class,
ModuleMake::class,
CreateSuperAdmin::class,
RefreshLQIP::class,
Expand Down
41 changes: 0 additions & 41 deletions src/Commands/UpdateCmsAssets.php

This file was deleted.

52 changes: 0 additions & 52 deletions src/Commands/stubs/form.blade.stub
Original file line number Diff line number Diff line change
@@ -1,52 +0,0 @@
{{--

@extends('cms-toolkit::layouts.resources.form')

@section('form')
{{ Form::model($form_fields, $form_options) }}
@formField('publish_status')
<section class="box">
<header class="header_small">
<h3><b>{{ $form_fields['title'] or 'New item' }}</b></h3>
</header>
@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?'
])
</section>
@formField('medias', ['media_role' => 'media_role'])
@formField('files', ['file_role' => 'file role', 'file_role_name' => 'Role name'])
@formField('block_editor', ['field_name' => 'content'])
@stop

--}}
55 changes: 0 additions & 55 deletions src/Commands/stubs/form_translatable.blade.stub
Original file line number Diff line number Diff line change
@@ -1,55 +0,0 @@
{{--

@extends('cms-toolkit::layouts.resources.form')

@section('form')
{{ Form::model($form_fields, $form_options) }}
@formField('publish_status')
<section class="box">
<header class="header_small">
<h3><b>{{ $form_fields['title'] or 'New item' }}</b></h3>
</header>
@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?'
])
</section>
@formField('medias', ['media_role' => 'media_role'])
@formField('files', ['file_role' => 'file role', 'file_role_name' => 'Role name'])
@formField('block_editor', ['field_name' => 'content'])
@stop

--}}
40 changes: 0 additions & 40 deletions src/Commands/stubs/index.blade.stub
Original file line number Diff line number Diff line change
@@ -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,
]
]
])

--}}
68 changes: 0 additions & 68 deletions src/Commands/stubs/repository.stub
Original file line number Diff line number Diff line change
Expand Up @@ -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);
* }
*
*/
}
2 changes: 1 addition & 1 deletion src/Helpers/model_helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/Http/Controllers/Admin/FeaturedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down

0 comments on commit df5912b

Please sign in to comment.