Upgrading

  1. Update composer.json to the version you want (or leave a ^ in the version...)
  2. Run enso composer update --with-dependencies yadda/enso-core
  3. Follow any relevant notes below (from bottom to top)

Publishing Assets

You will probably need to publish Enso JS, CSS, webpack.mix.js etc.

# Publish ALL files (won't overwrite existing files)
enso artisan vendor:publish

# Force re-publish only css and js files
enso artisan vendor:publish --force --tag=assets
Warning!
You probably don't want to use `--force` without also using `--tag=assets`!

Upgrade notes

v0.2.293

Add the following to config/enso/media.php:

/**
  * How to handle resizing gifs
  *
  * original = provide URL for original file, regardless of requested preset
  * warp = force the gif to the requested size without cropping
  * crop = resize image and crop accordingly
  */
'gif_strategy' => env('ENSO_GIF_STRATEGY', 'crop'),

v0.2.290

If you are using the IsPublishable Enso trait and you use the PublishAt date, you will need to add it it manually to your models with:

/**
 * Gets the name of the Publish At column on this publishable
 *
 * @return string
 */
public function getPublishAtColumn()
{
    return 'publish_at';
}

The following attribute modifiers have been removed from the trait. If you are still using them or their attribute calls, you should move over to using a DateTimeField instead.

getPublishAtHoursAttribute setPublishAtHoursAttribute getPublishAtMinutesAttribute setPublishAtMinutesAttribute

This trait now throws PublishableException instead of basic Exceptions

The accessibleToUser query scope now only accepts instances of UserContract, or null to use the current Authenitcated User

The isPublished query scope has been renamed to published to prevent potential collision with the function of the same name. isNotPublished has likewise been converted to notPublished.

v0.2.282

The default textarea rowspec has been removed from the Page content field. It was rarely used but if you want to keep it you should add the following to your own Page CRUD config.

FlexibleContentSection::make('textarea')
    ->setLabel('Textarea')
    ->addFields([TextareaField::make('textarea')]),

Yadda\Enso\Crud\Forms\Sections\TextImageSection has been removed completely. If you need it, you should define it yourself, i.e. in App\Crud.

Yadda\Enso\Crud\Forms\Sections\ImageTextSection has been updated to include title, section title, id, alignment, etc. The previously existing Wysiwyg field was called text. It has been updated to content. You should either update your data to be inline with this (this is preferable), or override the rowspec and rename the field.

v0.2.268

HasUuids has been changed to only reference a single uuid column. Replace your protected $uuids_columns array with a protected $uuid_column string. Additionally, if you installed webpatser/laravel-uuid:2.* for the previous version, you may also remove it.

v0.2.267

If your app already has traits for HasUuid, for frontend controller UsesPages or for Crud PublishesItems and IsPublishableCrud, you can now replace them with their Enso counterparts.

v0.2.259 - v0.2.263

No changes required

v0.2.258

Code quality tool config files now come bundled with Enso. You may need to install a few packages:

enso yarn add eslint prettier eslint-config-airbnb eslint-config-prettier eslint-plugin-prettier stylelint-config-airbnb

composer global require squizlabs/php_codesniffer

v0.2.253 - 254

No changes required.

v0.2.252

A Vuex store has been added by default. You will need to add it with yarn add vuex.

After this, you will need to update resources/assets/js/enso.js to import and include the store into your base Vue component. It should look something like:

import store from "./vendor/enso/store";

/**
 * Add custom store modules here with store.registerModule(moduleName, storeModule);
 */

var App = new Vue({
  store,
  mixins: [admin_mixin]
});

v0.2.249 - v0.2.251

This update introduces image optimization though it is disabled by default. You should add this option to config/enso/media.php:

/**
 * If true, resized images will be run through Spatie Image Optimizer
 */
'optimize_images' => env('ENSO_OPTIMIZE_IMAGES', false),

If you want to enable image optimization, you should enable this option and install the appropriate optimizers.

v0.2.133 - v0.2.248

No changes required.

v0.2.132

Update Mix to 4.x.x

yarn add laravel-mix@^4.0.14 sass@^1.16.0 sass-loader@^7.1.0 query-string

Remove .mix from webpack.mix.js

let mix = require("laravel-mix").mix;
// becomes
let mix = require("laravel-mix");

v0.2.130

  1. Refactored Form's Section list and Section's Field list. These are no-longer indexed by number, and are instead ordered by using specific function calls to insert items at the desired place. You should work through your Cruds (and possibly controllers) to ensure that they appear in the correct order, and replace the deprecated getSectionByName, removeSectionByName, getFieldByName and removeFieldByName with their new counterparts: getSection, removeSection, getField, removeField respectively.

v0.2.123 - v0.2.129

No additional changes required

v0.2.122

  1. The following templates have had changes. If you have made override copies locally, ensure that they contain any updates (for example, the \$row_index value in the foreach loop):
  • resources/views/crud/flex-partials/default-row.blade.php
  • resources/views/crud/flex-partials/flexible-content.blade.php
  1. Field-based validation has also been applied to their repsective Vue components. We recommend checking over your CRUD pages to make sure any validation rules that previously applied to server-side validation also work in client-side validation.

v0.2.121

You can now use the make() method on Fields and sections. For example, instead of:

$form->getSectionByName('content')
    ->getFieldByName('content')
    ->addRowSpecs([
        (new FlexibleContentSection('wysiwyg'))
            ->addFields([
                (new WysiwygField('wysiwyg')),
            ])
            ->addSettingsFields([
                (new CheckboxField('hidden'))
                    ->setLabel('This is the label')
                    ->setOptions([
                        'hidden' => 'Hidden',
                    ])
                    ->setDefaultValue(0),
            ]),
    ]);

...you can now do this:

$form->getSectionByName('content')
    ->getFieldByName('content')
    ->addRowSpecs([
        FlexibleContentSection::make('wysiwyg')
            ->addFields([
                WysiwygField::make('wysiwyg'),
            ])
            ->addSettingsFields([
                CheckboxField::make('hidden')
                    ->setLabel('This is the label')
                    ->setOptions([
                        'hidden' => 'Hidden',
                    ])
                    ->setDefaultValue(0),
            ]),
    ]);

The old way will still work the same as before but this should make things easier to read.

v0.2.118 - 120

If you do not need the Mailer - Do nothing. Otherwise, see the documentation for including Mailer

v0.2.115

Due to the inability to return non-file responses to Download based Bulk Actions, the routing has changed.

  • is_download is no longer a valid parameter for a bulk action. It should be removed.
  • The route parameter should direct to a controller that checks to see whether a download is allowed, returning success or error states.
  • If a download is allowed, the success data should contain a link to another url where you can actually download the file, and returns is as a data stream to force browser download. See Docs.

v0.2.108

Margin has been added to the bottom of <p>s in WYSIWYG. If you have previously compensated for this on the fronted by removing/adding margin on frontend <p>s then you will need to refactor this.

You will need to the following to config/enso/media.php:

/**
    * Whether or not to show the "this file is in use and can not be deleted"
    * message. If false a generic "this may be in use" message will be
    * shown instead.
    */
'show_file_in_use_message' => env('ENSO_MEDIA_FILE_IN_USE_DIALOG', false),

v0.2.106

This update adds the new file uploader. You should replace ImageUploadField, AudioUploadField, VideoUploadField and FileUploadField with FileUploadFieldResumable.

Add the HasFilesTrait to every model that has files.

Install some extra packages.

composer update yadda/enso-core --with-dependencies
yarn add portal-vue

Migrate your database.

php artisan migrate

Add the following to config/enso/crud.php:

'file' => [
    'controller'   => Yadda\Enso\Media\Controllers\FileController::class,
    'config'       => Yadda\Enso\Media\Crud\File::class,
    'model'        => Yadda\Enso\Media\Models\MediaFile::class,
],

Add the following to config/app.php:

Pion\Laravel\ChunkUpload\Providers\ChunkUploadServiceProvider::class,

v0.2.104

You can publish auth views (login, register etc) by running the following command. This will overwrite existing auth views, so you should only do this if your current ones haven't already been styled.

php artisan vendor:publish --force --tag=authviews

v0.2.101

Google Analytics/GTag/GTM settings and views are now available. You should upgrade the site to use them. See the Google Analytics page for details.

v0.2.94

Add the EnsoMeta facade to your config/app.php:

'EnsoMeta' => Yadda\Enso\Facades\EnsoMeta::class,

Add meta tags to your layouts/app.blade.php and whereever else you need it. In the <head> replace your <title> with:

@include('enso-meta::display');

You can now remove the uploader_preview and (if you're not using it for your own thumbnails) thumbnails presets from config/enso/media.php.

Many getters have been removed from Yadda\Enso\Meta\Traits\HasMeta. If you are using your own meta template, this may cause you some problems, but you should probably just replace that with the include above anyway.

v0.2.91

Page Crud no longer uses HTMLPurifier. This should be an improvement but you may wish to search for e.g. &amp; and replace with &.

v0.2.86

You will need to publish new files (not just force re-publish the assets tag). Then add two new routes

Route::post('admin/pages/publish', 'Admin\PagePublishController@publish')->name('admin.pages.publish');
Route::post('admin/pages/unpublish', 'Admin\PagePublishController@unpublish')->name('admin.pages.unpublish');

v0.2.83

You will need to install sweetalert2

yarn add sweetalert2

v0.2.82

You will need to install resumablejs

yarn add resumablejs

v0.2.77

You will need to install moment-timezone

yarn add moment-timezone

v0.2.72

You will need to use this workaround in order for the migrations to work:

v0.2.59

  • Publish the error views

    php artisan vendor:publish --tag=errors
    

v0.2.47

  • Override View logic for Enso views has been refactored. You will need to ensure all crud override view are situated as crud.[views_dir].[view_name]. NOTE: This change does not affect the location of Flexible Content Templates.
  • If you've added any custom logic to make Images as Settings have working previews, you can remove it.

 v0.2.46

  • The Settings Menu item has been registered in it's service provider. If it's been registered elsewhere, you will need to remove that code.

 v0.2.37 - v0.2.39

  • If you have altered / referenced / moved the base Enso 'navbar' template, you will need to alter your code that does so. It has moved from enso::navbar to enso::layouts.partials.navbar
  • Items are now added by related Service Providers. As a result, you may (will) see duplicate entries for core features. These will need to be removed from where they have otherwise been added (config files, other service providers)
  • Config file:
    • The items array should still work (for now), but is deprecated. Move adding items to appropriate service providers.
    • Add the new max_depth property to your enso.menu config file. Enso Default is 2, although all current apps (at time of writing) can only utilise 1 well.

 v0.2.30

Asset publishing from enso has been updated. Re-publishing the assets is only half the update this time. For existing builds, you'll also need to create /resources/assets/js/enso.js/, and add the following code (that would normally deployed with the first run of Enso)

// Make all App specific changes in this file.

import Vue from "vue";

// This import is your base enso-admin file. You should
// not edit it, it will be overriden as JS changes to Enso
// are made.
import admin_mixin from "./vendor/enso/enso-admin";

var App = new Vue({
  mixins: [admin_mixin]
});

You can then udpate your webpack's admin js call to:

.js('resources/assets/js/enso.js', 'public/js/enso-admin.js')

Similarly, you can create the new file /resources/assets/sass/enso.scss/, and add:

@import "enso/enso-admin";

You can then update your webpack's admin scss call to:

.sass('resources/assets/sass/enso.scss', 'public/css/enso-admin.css')

This will give you a place to add your own javascript and styles that won't get overwritten by publishing assets that are often required by Enso update.

Finally, you can update your resolved modules list to just these two. Everything else is redundant.

modules: [
  path.resolve(__dirname, "vendor/yadda/enso-core/resources/assets/js"),
  path.resolve(__dirname, "node_modules")
];

You 'May' also need to update version of js files. We really need to get better at that bit

v0.2.28

Crud Search functionality has been deprecated. After republishing assets, consider refactoring and existing search boxes into Filters. At some point, Search WILL be removed.

v0.2.18

You will need to add the following to your webpack.mix.js in order for SVGs to work:

.version([
    'public/svg/sprite.svg'
])

v0.2.0

  • IMPORTANT: If you have used a WYSIWYG field in Page data, you will need to migrate the contents of the data. Previously these fields were stored in two properties of the JSON: html and json. It is now stored in in "your_field_name": {"html": '', "json": ''}.

v0.1.80

  • Add Grimzy\LaravelMysqlSpatial\SpatialServiceProvider::class, to you config/app.php providers.

v0.1.79

  • yarn add vue2-leaflet

v0.1.78

  • If it doesn't exist, add 'uploader_preview' => [200, 200], to presets in config/enso/media.php.

v0.1.73 to v0.1.74

  • You will need to re-run migrations after updating to this version.
  • You may need to amend your page model. The base PageModel has had it's fillable, casts and attributes arrays amended. If you have overridden these, you will need to ensure you have everything new from Enso.
  • If you have added a column called data on your pages table that ISN'T a json column for a JsonDataSection, you will need to remove referece to it in your overriden page model.

v0.1.72 to v0.1.73

  • You will need to re-run migrations after updating to this version.

v0.1.63 to v0.1.64

  • If you have accounted for Meta Descriptions having <p> tags, you will need to remove those (and possibly updated the database to remove them where they are stored)

v0.1.50 to v0.1.51

Bare Minimum:
  • Register Yadda\Enso\EnsoMediaServiceProvider::class, in app/config.php
  • Re-run Migrations.
Additionally:
  • Additionally: Change references to the class Yadda\Enso\Media\MediaFile (or ImageFile etc etc) to get_class(resolve(\Yadda\Enso\Media\Contracts\MediaFile::class)) (probably use a use statement). The former will still work, but if you have (or do) extend a File model, it will not act in the expected way across the whole site if.

v0.1.45 to v0.1.49

  • You will need to republish assets and recompile.

v0.1.43 to v0.1.44

  • Register Yadda\Enso\EnsoUserServiceProvider::class, in app/config.php
  • Run php artisan vendor:publish, to push new extendable files.
  • Update config/enso/crud.php to be more like:
  • 'role' => [
        'controller'    => App\Http\Controllers\Admin\RoleController::class,
        'config'        => App\Crud\Role::class,
        'model'         => App\Role::class,
    ],
    
    'user' => [
        'controller'    => App\Http\Controllers\Admin\UserController::class,
        'config'        => App\Crud\User::class,
        'model'         => App\User::class,
    ],
    
  • Copy Functionality from existing App\Crud\EnsoUser to App\Crud\User;

  • Copy Functionality from existing App\Crud\EnsoRole to App\Crud\Role;
  • Register new bindings if (and you almost certainly are) overriding in a ServiceProvider

    use Yadda\Enso\Users\Contracts\User as UserContract;
    use App\User as UserConcrete;
    
    use Yadda\Enso\Users\Contracts\roles as RoleContract;
    use App\Role as RoleConcrete;
    
    ...
    
    public function register()
    {
      app()->bind(UserContract::class, UserConcrete::class);
      app()->bind(RoleContract::class, RoleConcrete::class);
    }
    
  • Potentially Update The following files to extends their new base versions (name change) if they exist

    • App\Http\Controllers\Admin\UserController.php from use Yadda\Enso\Users\Controllers\EnsoUserController to use Yadda\Enso\Users\Controllers\UserController
    • App\Http\Controllers\Admin\RoleController.php from use Yadda\Enso\Users\Controllers\EnsoRoleController to use Yadda\Enso\Users\Controllers\RoleController

v0.1.40 to v0.1.41

  • Replace use of RelationshipRepeaterField with a relationship-type specific version i.e. BelongsToManyRepeaterField.
  • You may be able to remove some callbacks from CRUD that were previously required.

v0.1.33 and v0.1.34 and v0.1.35

  • This update changed some Vue components. You will need to republish the assets and recompile.

    php artisan vendor:publish --force --tag=assets
    npm run dev
    
  • You may also need to install an older version of vue2-dropzone to make images display correctly.

    yarn add [email protected]
    

v0.1.32

  • For WYSIWYG support you will need to install Quill and Quill Render.

    yarn add quill quill-render
    
  • Add the following to the config in webpack.mix.js:

    const webpack = require('webpack');
    
    // ... and ...
    
    plugins: [
      new webpack.NormalModuleReplacementPlugin(/^\.\/package$/, function (result) {
        if (/cheerio/.test(result.context)) {
          result.request = "./package.json"
        }
      }),
    ]
    

v0.1.31

  • You can remove the SVG Blade directive that is regularly copied into new projects. It's part of core Enso now.
  • If you have manually extended any of the following files, you may need to check and update:
    • resources/views/crud/create.blade.php
    • resources/views/crud/edit.blade.php

v0.1.28

  • If you haven't already done so, make some minor changes to how we reference images. This is intended to allow for site specific alterations to the image model without breaking reliant packages:
    • use Yadda\Enso\Media\Contracts\ImageFile as ImageFileContract;
    • Replace references to Yadda\Enso\Media\Models\ImageFile with $image_model = resolve(ImageFileContract::class);.

v0.1.27

  • Add an 'import_directory' attribute to config/enso/media.php. Default value is 'imports'.
  • Rerun migrations - 'original_filename' added to files table.

v0.1.26

  • Check through models with FlexibleContentFields, and update \$attributes entry from [] to "[]".

v0.1.22

  • If you've used crud.update.rules you will need to add $id as a second parameter and update the number of parameters parameter.

v0.1.21

  • Add a 'disk' attribute to config/enso/media.php. Default value is 'local' but you may wish to use 's3' or something.
  • Add a 'directory' attribute to config/enso/media.php. Default value is 'media'.

If you're using deployer, you can use the deploy:public_disk task to link the storage directory to the shared storage directory. E.g.

after('deploy:symlink', 'deploy:public_disk');

v0.1.16

  • Add the following to providers in config/app.php

    Mews\Purifier\PurifierServiceProvider::class,
    
  • Add the following to aliases in config/app.php

    'Purifier' => Mews\Purifier\Facades\Purifier::class,
    
  • Create config/purifier.php OR run the following

    php artisan vendor:publish --provider="Mews\Purifier\PurifierServiceProvider"
    

v0.1.13 -> v.0.1.14

  • Add routes for admin pages, users, roles and media to your routes/web.php

    EnsoCrud::routes('admin/pages', "\\" . config('enso.crud.page.controller'), 'admin.pages');
    EnsoCrud::routes('admin/users', "\\" . config('enso.crud.user.controller'), 'admin.users');
    EnsoCrud::routes('admin/roles', "\\" . config('enso.crud.role.controller'), 'admin.roles');
    Route::post('admin/media/upload', ['as' => 'admin.media.upload', 'uses' => '\Yadda\Enso\Media\Controllers\UploadsController@uploadFile']);
    

v0.1.5 -> v.0.1.6

  • config/enso/media.php now has a mime_types attribute for pairing mime types with Media types.

v0.1.1 -> v0.1.2

  • Page Content has been revised to use flexible content. You will need to manually copy over page content to fit.

v0.0.14 -> v0.1

  • Update Relationship fields in crud config from RelationshipField to the approriate field type i.e. BelongsToField.
    • Remove setRelationship() calls. These no longer exist.
    • Update the name. It is now always the name of the relationship.
    • Set options with setOptions() instead of as a setting. Valid options are a query builder or an array of options.
    • Remove deprecated setting - multiple. This is now defined by the type of field you pick.
    • Remove deprecated setting - ajax_url. This should be handled by calling useAjax(route, class_name)