v3.4.0
Changes
front-end
accessories
- adds permission checks for various document operations
filters
- cascades enso select event handlers in select filter
- adds v-model to date filter, with value required
- adds a
titleprop to date-filter - fixes tooltip in date-filter
- adds watcher for
valueprop in date-filter - fixes horizontal padding in vue-filter
forms
- allows passing
paramsin select fields - avoids scrollIntoView erorrs (eg when using hidden fields)
select
- adds watcher for
source - no longer fetches on click when the component is readonly / disabled
- locks selection when params / pivot-params / custom-params are changed until the new list of options is fetched
- removes
disable-filteringprop - disables front end filtering when using server-side
tables
- improves vResponsive directive
- refactors dtRowId
- adds a
FilterStatehelper component - renames bulma
Controlscomponent names - minor visual refactor
typeahead
- adds automatic route translation in enso-typeahead
- cascades clear
ui
- the
routehelper is no longer defined as global and must now be injected in every component - fixes menu label padding
- improves tag group template in search, adds horizontal scrolling
- fixes checkbox alignment in checkbox manager
- fixes params in dataimport index template
back-end
addresses
- removed superfluous validation
- removes address observer
- add laravel-enso/enums
- improves form extending, removes formTemplate from config
- adds lat and long fields in form, with custom validation rules
- renames DefaultAddress controller to SetDefault
- improves scopeFor to work with morphMap
- removes deprecated Addresses trait
- refactors exceptions
avatars
- removes redundant method call in default avatar
- upgrades laravolt/avatars to 3.0
calendars
- adds laravel-enso/enums
- adds enums service provider for registering calendars
charts
- small refactor
cli
- adds a package option. Now you can generate whole structure boilerplates directly in your
vendor/my-vendor/my-packagefolder - adds session saving. You can now configure a structure, exit (or encounter an error :P) then come back and continue from where you left
- adds unit tests
- adds laravel-enso/enums
comments
- removed superfluous validation
- small refactor
companies
- implements dependency injection in controllers
- adds rememberable, avoids deletion conflicts and relations traits to the company model
- adds laravel-enso/enums
- improves form for easier customization
- adds
fiscal_code,reg_com_nrandstatusfields in table migration - adds
CompanyStatusesenum - adds a
EnumServiceProvider - removes
companies.phpconfig file - removes default restrictions in Options controller
- adds fiscal_code to $queryAttributes in Options
- refactors exceptions
core
- adds laravel-enso/enums
- adds
EnumServiceProvider - fixes email unique validation in user form validation
- removes duplicate trait use in UserGroup
- adds rememberable on UserGroup
- adds rememberable, avoids deletion conflicts and relations traits to User
- improves user and group form for easier customization
- removes versionings as a requirement
- updates
Upgradecommand for 3.4.0
data-export
- adds a chunk option in config for setting the default value
- updates policies: view, share, destroy
- upgrades box/spout to 3.0
- implements the new AuthorizesFileAccess
data-import
- small refactor
- updates contracts (beforehook, importable, afterhook) to receive the authenticated user as well
- adds laravel-enso/enums
- implements AuthorizesFileAccess contract
- updates policies: view, share, destroy
- upgrades box/spout to 3.0
- refactors exceptions
discussions
- small refactor
documents
- removed superfluous validation
- updates policies: view, share, destroy
- implements AuthorizesFileAccess
dynamic-methods (new)
- a set of traits that allow adding methods / relations / mutators / accessors in models from a local service provider
enums (new)
- Enso Enum was moved from laravel-enso/helpers in itw own package
- has an EnumServiceProvider that allows registering enums that are sent by the app state builder to the front-end. The provider can be extended in any package or locally
files
- greatly improves the authorizan strategy
- adds AuthorizesFileAccess contract
- adds an UploadPolicy for view, share and destroy
- refactors exceptions
forms
- removes deprecated
allow-filteringoption from meta - adds
paramsto meta for select fields - allows use of nested attributes
- refactors exceptions
helpers
- adds an optional precision for all methods in Decimals
- adds floor and ceil to Decimals
- fixes an edge case bug in Obj's filled method
- adds DatabaseSeederProgress and SeederProgress traits that allow displaying a progress bar in the seed process
- updates InCents to do floor on converting in cents
- removes Enum (now lies in its own package)
how-to
- small general refactor
- refactors exceptions
image-transformer
- refactors exceptions
io
- adds laravel-enso/enums
localisation
- refactors the
localisationkey tolanguage - renamed form & table (builders & templates)
- improves form for easier customization
- refactors exceptions
logs
- refactors exceptions
menus
- small refactor
- improves form for easier customization
notifications
- removes unused vars in notification
people
- improves form for easier customization
- adds AvoidsDeletionConflicts, Relations, Rememberable on Person
- adds laravel-enso/enums
- adds EnumServiceProvider
- adds bank and bank_account to the table's migration
- adds uid to $queryAttributes in Option
- removes people.php config file
permissions
- small refactor
- improves form for easier customization
rememberable
- cacheGet($id) now return null if the model does not exist in the database
roles
- adds rememberable on Role
- adds laravel-enso/enums
- improves form for easier customization
- refactors exceptions
searchable
- casts labels sent to the front-end as strings
- refactors Finder.php
- improves the logic in Search.php
select
- refactors the option builder
tables
- small refactor & cleanup of redundant logic
- refactores filters
- dtRowId is now configurable and defaults to "id"
- the box/spout dependency was upgraded to the v3 version
- adds/uses
laravel-enso/enums - now uses the Laravel 6 Arr class instead of the global helpers
- adds
modelprop in template for customizing the model - refactors exceptions
track-who
- improves resources logic
- refactors auth helper into facade
- fixes updatedByTest
teams
- team now uses rememberable
tutorials
- small refactor
- improvements to form customization
- adds/uses
laravel-enso/enums
versions (new)
- alternative package to versioning where the version is kept on the model vs using a separate table
versioning
- improves flow, optimizes queries, fixes N+1 problem
- addresses scenario where N+1 queries were being made by using $with
- renames versioning table to precede all other model migrations
Upgrade steps
Local project
- update in composer.json:
- require
- "laravel-enso/control-panel-api": "2.3.*", // optional, if you are using it
- "laravel-enso/core": "4.4.*",
- "laravel-enso/enums" "1.1.*",
- require-dev
- "codedungeon/phpunit-result-printer": "^0.26.0",
- "facade/ignition": "^1.4",
- "nunomaduro/collision": "^3.0",
- "phpunit/phpunit": "^8.0"
- require
- update in package.json
- "@enso-ui/accessories": "~1.1.0",
- "@enso-ui/bulma": "~1.2.0",
- "@enso-ui/forms": "~1.2.0",
- "@enso-ui/select": "~1.1.0",
- "@enso-ui/tables": "~1.1.0",
- "@enso-ui/ui": "~1.5.0",
- rename
structuremanagertest suite tocliin phpunit.xml - remove from the local
Usermodel theAddresses&Documentstraits - update the
CompanyFactorywith the one from the github repo (of course, retain any local additions if necessary) - update
enso/exports.php,enso/tables.php,laravolt/avatar.phpconfig files with the ones from the github repo - delete the
enso/people.php&enso/companies.phpdeprecated configs - make sure to refactor any customisation to the people / companies forms or tables using dependency injection / binding in your
AppServiceProvider. The old customization mechanisms which were using configs have been removed. - search and replace
LaravelEnso\Helpers\app\Classes\Enum=>LaravelEnso\Enums\app\Services\Enum - either refactor all table builders and remove the
dtRowIdalias for the id, or update your local table templates and add"dtRowId": "dtRowId" - make sure you inject
routein all the VueJS components where the helper is used. Search for "route()" in your resources folder and refactor - refactor any customizations to documents, uploads, imports, exports to make use of the
AuthorizesFileAccesscontract - update all importers and classes implementing the
BeforeHook,ImportableandAfterHookcontracts, as thebefore,runandaftermethod signatures have changed and a and$userparameter was added - add a
valueparameter to alldate-filtersorenso-date-filterscomponent use - if you are currently using the Versioning package, manually add it as a dependency in your composer.json under
require, as it was removed as a dependency from Core - run
php artisan enso:upgrade
Optional: - now you can register/add Enums directly from your packages, to the application state, by using an
EnumServiceProvider.
Take a look at theEnumServiceProviderfrom the People package as an example.
If using this method, you won't need to add them in the project'sLocalState.
Laravel 6 file changes
bootstrap/app.php:- update the
$appvariable value
$app = new Illuminate\Foundation\Application( $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__) );- be sure to clear the cache (?
php artisan cache:clear)
- update the
configs/app.php:- add
'asset_url' => env('ASSET_URL', null), - add
'faker_locale' => 'en_US', - add the following aliases to the
aliasesarray
'Arr' => Illuminate\Support\Arr::class, 'Str' => Illuminate\Support\Str::class,- add
configs/auth.php:- add the following value to
guards.apiconfiguration array:'hash' => false,
- add the following value to
configs/broadcasting.php- replace
'encrypted' => true,with'useTLS' => true,in theconnections.pusher.optionsconfiguration array
- replace
configs/cache.php- add the dynamodb configuration to the
storesconfiguration array
'dynamodb' => [ 'driver' => 'dynamodb', 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 'endpoint' => env('DYNAMODB_ENDPOINT'), ],- update the
prefixvalue withenv('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),; Remember to importStr(Illuminate\Support\Str) class.
- add the dynamodb configuration to the
configs/database.php- add the following values to the
connections.sqliteconfiguration array:
'url' => env('DATABASE_URL'), 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),- add the following values to the
connections.mysqlconfiguration array:
'url' => env('DATABASE_URL'), 'prefix_indexes' => true, 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [],- add the following values to the
connections.pgsqlconfiguration array:
'url' => env('DATABASE_URL'), 'prefix_indexes' => true,- add the following values to the
connections.sqlsrvconfiguration array:
'url' => env('DATABASE_URL'), 'prefix_indexes' => true,- the
redisconfiguration array should be updated:
'redis' => [ 'client' => env('REDIS_CLIENT', 'predis'), 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), ],- add the following values to the
configs/filesystems.php- the following key values should be updated for the
disks.s3configuration array:
'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION'),Note that the AWS configuration keys have changed and should be updated within the env file as well.- the following key values should be updated for the
configs/logging.php- for the
channels.stackconfiguration array:- add the following value
'ignore_exceptions' => false, - update
channelsto'channels' => ['single'],// or 'daily'
- add the following value
- update the
channels.dailyvalue to'days' => 14, - add the new
papertrailvalue to thechannelsconfiguration array:
'papertrail' => [ 'driver' => 'monolog', 'level' => 'debug', 'handler' => SyslogUdpHandler::class, 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), 'port' => env('PAPERTRAIL_PORT'), ], ],- add the new
formattervalue to thechannels.stderrconfiguration array:'formatter' => env('LOG_STDERR_FORMATTER'),
- for the
configs/mail.php- add the following value:
'log_channel' => env('MAIL_LOG_CHANNEL'),
- add the following value:
configs/queue.php- add the following value to the
connections.beanstalkdconfiguration array:'block_for' => 0, - add the following values to the
connections.sqsconfiguration array:
'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 'queue' => env('SQS_QUEUE', 'your-queue-name'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),- add the following value to the
configs/services.php- add the following value to the
mailgunconfiguration array::'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), - add the
postmarkconfiguration:
'postmark' => [ 'token' => env('POSTMARK_TOKEN'), ],- update the
sesconfiguration:
'ses' => [ 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ],- remove the
stripeandsparkpostconfigurations
- add the following value to the
configs/session.php- update the
cookieconfiguration array:
Be sure to also import the'cookie' => env( 'SESSION_COOKIE', Str::slug(env('APP_NAME', 'laravel'), '_').'_session' ),Strclass.- update the
configs/view.php- update the
compiledconfiguration array:
'compiled' => env( 'VIEW_COMPILED_PATH', realpath(storage_path('framework/views')) ),- update the
resources/lang/en/validation.php
The following translation keys and their values have to be added:- 'date_equals'
- 'ends_with'
- 'gt'
- 'gte'
- 'lt'
- 'lte'
- 'not_regex'
- 'starts_wit'
- 'uuid'
tests/Bootstrap.phpfile was added.app/Http/Kernel.php- the
ThrottleRequestsmiddileware was added to the$middlewarePriorityvariable.
- the
.env- add if necessary
MAILGUN_ENDPOINT=api.eu.mailgun.net
- add if necessary