With Twill 3.x some files and classes are moved.
What changed:
- The
resources/views/admin
folder should be renamedresources/views/twill
- The
routes/admin.php
file should be renamed toroutes/twill.php
Namespace changes:
app/Http/Controllers/Admin -> app/Http/Controllers/Twill
app/Http/Requests/Admin -> app/Http/Requests/Twill
We provide an automated upgrade path using the commands explaned below. This will take care of:
- Namespace changes in your project
- Moving the twill views to the new namespace
- Moving the twill routes to the new location
- Fixing (most) compatibility issues.
Prepare the directories.
php ./vendor/area17/twill/upgrade.php
Previously withVideo
was true by default, if you relied on this you have to update these media fields to
'withVideo' => true
.
The default for media and file libraries are now local and glide, if you relied on the default config for aws
then you now need to specify this in your .env
.
The renderBlocks
method now by default will NOT render the nested repeaters below the block. If you relied on this
you now need to update to renderBlocks(true)
Model crops are now a global config, if you do not need model specific crops you can manage them globally from your config.
The default now is bigIncrements and bigInteger. If you relied on these functions for custom logic you can add them to your own codebase. For reference the functions are below:
if (!function_exists('twillIncrementsMethod')) {
/**
* @return string
*/
function twillIncrementsMethod()
{
return config('twill.migrations_use_big_integers')
? 'bigIncrements'
: 'increments';
}
}
if (!function_exists('twillIntegerMethod')) {
/**
* @return string
*/
function twillIntegerMethod()
{
return config('twill.migrations_use_big_integers')
? 'bigInteger'
: 'integer';
}
}
If you are overriding methods in your repository/controller or request classes. They may now need typed arguments and return types.
This is an ongoing effort and will continue to occur as 3.x evolves (but not in bugfix releases).