diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f11f81ac0..a54d41216 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.3 extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo coverage: none @@ -65,7 +65,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.2, 8.1, 8.0] + php: [8.3, 8.2, 8.1, 8.0] laravel: [9.*, 10.*] exclude: - laravel: 10.* diff --git a/CHANGELOG.md b/CHANGELOG.md index 580d770c9..4bfa73722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,81 @@ All notable changes to `twill` will be documented in this file. +## UNRELEASED (3.1.0) + +### Added +- Add connected fields support to the Twill 3 form builder by @joyceverheije in #2323 +- Support block component classes in the block editor `blocks` array by @joyceverheije in 8778ab7e +- Add `max` option to form builder `InlineRepeater` field by @joyceverheije in 4a773869 +- Make preview breakpoints configurable by @florrie-90 in #2299 +- Add `Link` column type to table builder by @agnonym in #2376 +- PHP 8.3 support by @antonioribeiro in #2374 +- Add `routePrefix` support to nested breadcrumbs by @yamaha252 in #2312 +- Add direction option to form input, textarea and WYSIWYG fields by @13twelve in #2295 +- Add read-only support to the form builder's Input field by @zachgarwood in #2331 +- Make permissions and roles table names configurable by @Keania-Eric in #2350 +- Support multiple nested table columns by @yamaha252 and @joyceverheije in #2314 and 1edbfbb1 +- Add support for current request only tertiary nav links by @joyceverheije +- Add support for titleInBrowser and adminEditUrl accessors in browsers by @joyceverheije +- Add configuration to controls whether a user should be created or not when a new user is logging in through Oauth by @joyceverheije +- Allow QuickFilter extension by @joyceverheije +- Automatically add `active` to `$translatedAttributes` by @driftingly in #2401 +- Add `--factory` and `--seeder` to `twill:make:module` by @driftingly in #2402 +- Update migration stub and existing migrations to use anonymous class by @driftingly in #2406 +- Add predefined class selection to TipTap link component by @zipavlin in #2336 +- Fix `parseInternalLinks` helper issues by @avinash403 in #2338 + +### Fixed +- Fix custom components registration by @joyceverheije in 7c233334 +- Turn move dropdowns off for settings blocks by @droplister in #2293 +- Fix scheduled filter label by @droplister in #2291 +- Fix related table name in migration down method by @droplister in #2290 +- Updated namespace paths from Admin to Twill on custom pages by @pauldwight in #2317 +- Fix type of $forceLocale in translatedInput() by @pvdbroek in #2315 +- Fix duplication when translated media fields are enabled by @petertsoisstuff in #2320 +- Support using a dot as `fieldsGroupsFormFieldNameSeparator` by @yamaha252 in #2277 +- Allow dashboard modules to wrap onto the next line by @florrie-90 in #2298 +- Always include locale in the mediables pivot by @bonroyage in #2368 +- Fixes to reduce excessive number of queries when using Twill 3 settings by @bonroyage in #2369 +- Update migration helper for translations table by @sauron in #2327 +- Fix x-position of full height crops being reset at some ratios/screen sizes by @13twelve in #2297 +- Fix optional feature migrations publication by @Tofandel in #2384 +- Fix build error with custom icons by @emanueljacob in #2392 +- Fix position value for blocks in non-default editors by @joyceverheije in #2381 +- Fix user list errors when deleting roles by @antonioribeiro in #2372 +- Fix keepAlive on connected non localized fields by @joyceverheije +- Fix active navigation check when a child module uses the same name as another module by @joyceverheije +- Avoid unused data and hooks when using the default role level by @joyceverheije +- Check user permission when displaying activity log items by @joyceverheije +- Remove block actions in settings blocks by @ifox +- Fix datepicker selection by @ifox +- Fix create button alignement in listings by @ifox +- Fixes incorrect order of nested items slug when item is more than 2 levels deep by @pauldwight in #2388 +- Fix getCapsuleForModel() for when passing a Model object by @antonioribeiro in #2400 +- Preserve default vselect value when undefined by @bwat-dev in #2311 +- Don't load DuskServiceProvider if dusk doesn't exist by @Tofandel in #2366 +- Use custom model configuration in the relationship morph map by @redelschaap in #2408 + +### Docs +- Add instructions on how to use the browser field with a custom pivot table by @poncianodiego and @ifox in https://github.com/area17/twill/pull/2385 +- Fix wrong property name in 12_nested-modules.md by @Viliasas in #2282 +- Fix artisan command by @thecrazybob in #2365 +- Fix typo in create page module guide by @colegeissinger in #2367 +- Content - Modules - TableBuilder: typo by @agnonym in #2375 +- Updates to the docs for nested modules by @pauldwight in #2389 +- Fix typo in 8_building-a-front-end.md by @driftingly in #2396 +- Changed example value to better reflect given example on 16_field-groups.md by @Viliasas in #2283 + +### Translations +- Added Slovenian language to translations by @Neoglyph in #2373 +- Update dutch lang files by @lindeVW in #2378 + +### Chores +- Update frontend dependencies by @ifox + ## 3.0.2 -## Fixed +### Fixed - Rendering of nested components blocks by @haringsrob in https://github.com/area17/twill/pull/2243 - Rendering of side form if it only contains fieldsets by @agnonym in https://github.com/area17/twill/pull/2234 @@ -14,7 +86,7 @@ All notable changes to `twill` will be documented in this file. - `Options::fromArray` argument order by @bonroyage in https://github.com/area17/twill/pull/2231 - Update package generator stub by @ifox in https://github.com/area17/twill/commit/78cc5b5dc023134356210f8c8940f77ff7745ea3 -## Improved +### Improved - Fix activity log typo by @DanielSpravtsev in https://github.com/area17/twill/pull/2264 - Fix two misspellings by @skoontastic in https://github.com/area17/twill/pull/2250 @@ -29,11 +101,11 @@ All notable changes to `twill` will be documented in this file. ## 3.0.1 -## Fixed +### Fixed - Fix Blade components resolution (causing an issue with Laravel Jetstream) by @haringsrob in https://github.com/area17/twill/pull/2223 -## Improved +### Improved - Add mobile nav to all docs site pages by @13twelve in https://github.com/area17/twill/pull/2224 - Fix WYSIWYG maxlength docs by @tttogo in https://github.com/area17/twill/pull/2226 diff --git a/composer.json b/composer.json index 95204c0db..fcb548a27 100644 --- a/composer.json +++ b/composer.json @@ -48,8 +48,8 @@ "area17/phptorch": "dev-main", "chillerlan/php-qrcode": "~4.0", "friendsofphp/php-cs-fixer": "^3.0", - "nette/php-generator": "v4.0.3", - "nunomaduro/collision": "^6.0", + "nette/php-generator": "^4.0.3", + "nunomaduro/collision": "^6.0|^7.0|^8.0", "nunomaduro/larastan": "^2.0", "orchestra/testbench": "^7.8|^8.0", "orchestra/testbench-dusk": "^7.8|^8.0", diff --git a/config/dashboard.php b/config/dashboard.php index 060eb5552..85d3fec49 100644 --- a/config/dashboard.php +++ b/config/dashboard.php @@ -12,7 +12,7 @@ */ 'modules' => [], 'analytics' => ['enabled' => false], - 'search_endpoint' => 'twill.search', + 'search_endpoint' => config('twill.admin_route_name_prefix') . 'search', /* |-------------------------------------------------------------------------- diff --git a/config/oauth.php b/config/oauth.php index 090e5252e..2cfc2cdb8 100644 --- a/config/oauth.php +++ b/config/oauth.php @@ -15,6 +15,17 @@ */ 'providers' => ['google'], + /* + |-------------------------------------------------------------------------- + | This boolean controls whether a user should be created or not + | when a new user is logging in through Oauth + |-------------------------------------------------------------------------- + | + | Possible values: true, false + | + */ + 'create_user_with_default_role' => true, + /* |-------------------------------------------------------------------------- | New user default role name (legacy) diff --git a/docs/content/1_docs/16_artisan-commands/index.md b/docs/content/1_docs/16_artisan-commands/index.md index ca713bb0d..39bdc471a 100644 --- a/docs/content/1_docs/16_artisan-commands/index.md +++ b/docs/content/1_docs/16_artisan-commands/index.md @@ -25,7 +25,7 @@ php artisan twill:refresh-crops {--dry : Print the operations that would be performed without modifying the database}` - ``` -* `php artisan twill:make:module` - Generate a new module, see [CLI Generator](./../3_modules/2_cli-generator.md) +* `php artisan twill:make:module` - Generate a new module, see [CLI Generator](./../3_modules/2_cli-generator.md) ``` php artisan twill:make:module {moduleName} @@ -39,10 +39,15 @@ php artisan twill:make:module {moduleName} {--N|hasNesting} {--bladeForm} {--E|generatePreview} - {--parentModel=} {--all} + {--force} + {--factory} + {--seeder} + {--packageDirectory=} + {--packageNamespace=} + {--parentModel=} ``` - + * `php artisan twill:make:singleton` - Generate a new singleton, see [CLI Generator](./../3_modules/2_cli-generator.md) ``` @@ -56,14 +61,16 @@ php artisan twill:make:singleton {moduleName} {--E|generatePreview} {--bladeForm} {--all} + {--force} + {--factory} + {--packageDirectory=} + {--packageNamespace=} + {--parentModel=} ``` * `php artisan twill:make:capsule` - Generate a new capsule, see [CLI Generator](./../3_modules/2_cli-generator.md) ``` -php artisan twill:make:capsule {moduleName} - {--singleton} - {--packageDirectory=} - {--packageNamespace=} +php artisan twill:make:capsule {moduleName} {--B|hasBlocks} {--T|hasTranslation} {--S|hasSlug} @@ -73,9 +80,15 @@ php artisan twill:make:capsule {moduleName} {--R|hasRevisions} {--N|hasNesting} {--E|generatePreview} + {--singleton} {--bladeForm} {--all} {--force} + {--factory} + {--seeder} + {--packageDirectory=} + {--packageNamespace=} + {--parentModel=} ``` * `php artisan twill:list:icons {filter? : Filter icons by name}` - List available icons diff --git a/docs/content/1_docs/3_modules/12_nested-modules.md b/docs/content/1_docs/3_modules/12_nested-modules.md index c4b689ba2..d5b399107 100644 --- a/docs/content/1_docs/3_modules/12_nested-modules.md +++ b/docs/content/1_docs/3_modules/12_nested-modules.md @@ -39,11 +39,11 @@ $slug = $item->getNestedSlug($lang); To include all ancestor slugs in the permalink of an item in the CMS, you can dynamically set the `$permalinkBase` property from the `form()` method of your module controller: ```php -class PageController extends ModuleController +class PageController extends NestedModuleController { //... - protected function form($id, $item = null) + protected function form(?int $id, TwillModelContract $item = null): array { $item = $this->repository->getById($id, $this->formWith, $this->formWithCount); @@ -68,9 +68,24 @@ Route::get('{slug}', function ($slug) { })->where('slug', '.*'); ``` -For more information on how to work with nested items in your application, you can refer to the +For more information on how to work with nested items in your application, you can refer to the [laravel-nestedset package documentation](https://github.com/lazychaser/laravel-nestedset#retrieving-nodes). +### Setting a maximum nested depth + +You can also define the maximum depth allowed for the module changing the following: +```php +protected $nestedItemsDepth = 1; +``` +Note: a depth of 1 means parent and child. + +### Working with browser fields + +By default only a parent item will be visible to the browser field. If you want to show child items when browsing for the module you can set `$showOnlyParentItemsInBrowsers` to false: +```php +protected $showOnlyParentItemsInBrowsers = false; // default is true +``` + ## Parent-child modules Parent-child modules are 2 distinct modules, where items of the child module are attached to items of the parent module (e.g. Issues can contain Articles): @@ -85,23 +100,20 @@ We'll use the `slug` and `position` features in this example but you can customi ``` php artisan twill:make:module issues -SP -php artisan twill:make:module issueArticles -SP --parentModel=Issue +php artisan twill:make:module issueArticles -SP --parentModel=Issue ``` Add the `issue_id` foreign key to the child module's migration: ```php -class CreateIssueArticlesTables extends Migration +public function up() { - public function up() - { - Schema::create('issue_articles', function (Blueprint $table) { - // ... - $table->foreignIdFor(Issue::class); - }); - + Schema::create('issue_articles', function (Blueprint $table) { // ... - } + $table->foreignIdFor(Issue::class); + }); + + // ... } ``` @@ -122,7 +134,7 @@ class IssueArticle extends Model implements Sortable // ... 'issue_id', ]; - + public function issue() { return $this->belongsTo(Issue::class); diff --git a/docs/content/1_docs/3_modules/6_table-builder.md b/docs/content/1_docs/3_modules/6_table-builder.md index e73acbc2b..dc89cfdf0 100644 --- a/docs/content/1_docs/3_modules/6_table-builder.md +++ b/docs/content/1_docs/3_modules/6_table-builder.md @@ -125,7 +125,7 @@ The example blow illustrates a possible usage: Text::make() ->field('customField') ->customRender(function (Model $model) { - return view('my.view', ['title' => $model->title'])->render(); + return view('my.view', ['title' => $model->title])->render(); }); ``` diff --git a/docs/content/1_docs/4_form-fields/02_wysiwyg.md b/docs/content/1_docs/4_form-fields/02_wysiwyg.md index 64e146acb..83934c84a 100644 --- a/docs/content/1_docs/4_form-fields/02_wysiwyg.md +++ b/docs/content/1_docs/4_form-fields/02_wysiwyg.md @@ -78,7 +78,7 @@ $wysiwygOptions = [ 'underline', 'strike', 'blockquote', - "code-block", + 'code-block', 'ordered', 'bullet', 'hr', @@ -86,6 +86,7 @@ $wysiwygOptions = [ 'link', 'clean', 'table', + 'align', ]; @endphp @@ -148,11 +149,12 @@ With the Tiptap wysiwyg editor you can access some additional features. Below is When needed, you can let users browse internal content, this can be especially useful to maintain correct links inside wysiwyg editors. -This can currently only be done using the Form builder by adding the browsermodules to the +This can currently only be done using the Form builder by adding `browserModules` to the wysiwyg field: ```php -Wysiwyg::make()->name('description') +Wysiwyg::make() + ->name('description') ->label('Description') ->translatable() ->browserModules([Page::class]) @@ -173,6 +175,21 @@ For regular fields on models you will have to manually call `parseInternalLinks` {{ \A17\Twill\Facades\TwillUtil::parseInternalLinks($item->description) }} ``` +### Link style + +If needed, you can let users add specific classes to links, which can be especially useful to create CTA or similar button-like hyperlinks that are styled differently than regular links. + +This can currently only be done using the Form builder by adding `classList` to the +wysiwyg field: + +```php +Wysiwyg::make() + ->name('description') + ->label('Description') + ->translatable() + ->classList(['btn' => 'Show this link as button']) +``` + ## Manually setting input direction Introduced in `v3.1.0` diff --git a/docs/content/1_docs/4_form-fields/10_browser.md b/docs/content/1_docs/4_form-fields/10_browser.md index c797c1d98..c7f535245 100644 --- a/docs/content/1_docs/4_form-fields/10_browser.md +++ b/docs/content/1_docs/4_form-fields/10_browser.md @@ -71,7 +71,7 @@ titled [Adding browser fields to a block](../5_block-editor/04_adding-browser-fi explanation. Outside the block editor, browser fields are used to save `belongsToMany` relationships. The relationships can be stored -in Twill's own `related` table or in a custom pivot table. +in Twill's own `twill_related` table or in a custom pivot table. ## Using browser fields as related items @@ -266,6 +266,50 @@ public function getBrowserData($prependScope = []) In the presented example, this will make sure only variants of the selected product in the first browser can be selected in the second one. +## Using a custom pivot table + +Using the `HasRelated` trait means that Twill is storing the relationship in a polymorphic table, which can make efficient database queries harder to implement depending on the needs of your frontend. Using a pivot table between 2 Twill models is available if you need it. + +- Create your pivot table: + +```php + Schema::create('artist_artwork', function (Blueprint $table) { + createDefaultRelationshipTableFields($table, 'artist', 'artwork'); + $table->integer('position')->unsigned()->nullable(); + }); +``` + +- Add the relationship to your model (i.e. `Artist`): +```php + public function artworks(): BelongsToMany + { + return $this->belongsToMany('artworks')->orderByPivot('position'); + } +``` + +- Configure the `$browsers` property in your repository (i.e. `ArtistRepository`): + +```php + protected $browsers = ['artworks']; +``` + +Additional parameters can also be overridden with an array. When only the browser name is given, the rest of the parameters are inferred from the name. + + +```php + protected $browsers = [ + 'artworks' => [ + 'titleKey' => 'title', + 'relation' => 'artworks', + 'browserName' => 'artworks', + 'moduleName' => 'artworks', + 'positionAttribute' => 'position', + ], + ]; +``` + +For even more control, you can use [updateBrowser()](https://twillcms.com/docs/api/3.x/A17/Twill/Repositories/Behaviors/HandleBrowsers.html#method_updateBrowser) in your own `afterSave()` method and [getFormFieldsForBrowser()](https://twillcms.com/docs/api/3.x/A17/Twill/Repositories/Behaviors/HandleBrowsers.html#method_getFormFieldsForBrowser) in your own `getFormFields()` method. + ## Morphable browser fields While a bit more complex to setup, you can target a morphTo. diff --git a/docs/content/1_docs/4_form-fields/11_repeater.md b/docs/content/1_docs/4_form-fields/11_repeater.md index 6cbbc2f3c..838f0d829 100644 --- a/docs/content/1_docs/4_form-fields/11_repeater.md +++ b/docs/content/1_docs/4_form-fields/11_repeater.md @@ -179,19 +179,16 @@ php artisan twill:make:module TeamMember -P relationship: ```php -class CreateTeamMembersTables extends Migration +public function up() { - public function up() - { - Schema::create('team_members', function (Blueprint $table) { - /* ... */ - - $table->foreignId('team_id') - ->constrained() - ->onUpdate('cascade') - ->onDelete('cascade'); - }); - } + Schema::create('team_members', function (Blueprint $table) { + /* ... */ + + $table->foreignId('team_id') + ->constrained() + ->onUpdate('cascade') + ->onDelete('cascade'); + }); } ``` @@ -306,5 +303,3 @@ of the repeater items. This directive also accepts a `hidePrefix` option to hide :required="true" /> ``` - - diff --git a/docs/content/1_docs/4_form-fields/16_field-grouping.md b/docs/content/1_docs/4_form-fields/16_field-grouping.md index 78dcab14f..f4e636734 100644 --- a/docs/content/1_docs/4_form-fields/16_field-grouping.md +++ b/docs/content/1_docs/4_form-fields/16_field-grouping.md @@ -104,7 +104,7 @@ In the repository file you can setup the following parameters: ```php public bool $fieldsGroupsFormFieldNamesAutoPrefix = true; -public string $fieldsGroupsFormFieldNameSeparator = '-'; // Default is _ +public string $fieldsGroupsFormFieldNameSeparator = '.'; // Default is _ ``` This will automatically group/ungroup these fields based on the separator: diff --git a/docs/content/1_docs/5_block-editor/02_creating-a-block-editor.md b/docs/content/1_docs/5_block-editor/02_creating-a-block-editor.md index 1ff591458..1d3e2595f 100644 --- a/docs/content/1_docs/5_block-editor/02_creating-a-block-editor.md +++ b/docs/content/1_docs/5_block-editor/02_creating-a-block-editor.md @@ -31,6 +31,17 @@ BlockEditor::make() + +@php + $excludeBlocks = [ + 'title', + 'quote' + ]; +@endphp + + ``` :::#tab::: @@ -41,6 +52,10 @@ BlockEditor::make() @formField('block_editor', [ 'blocks' => ['title', 'quote', 'text', 'image', 'grid', 'test', 'publications', 'news'] ]) + +@formField('block_editor', [ + 'excludeBlocks' => ['title', 'quote'] +]) ``` :::#tab::: diff --git a/docs/content/1_docs/7_media-library/05_custom-metadata.md b/docs/content/1_docs/7_media-library/05_custom-metadata.md index b18b20f56..6bedb3ce1 100644 --- a/docs/content/1_docs/7_media-library/05_custom-metadata.md +++ b/docs/content/1_docs/7_media-library/05_custom-metadata.md @@ -1,6 +1,6 @@ # Custom metadata -By default, media comes with a few metadata attributes that can be filled in from the media managers: +By default, media comes with a few metadata attributes that can be filled in from the media managers: Tags, Alt text and caption. Say we want to add more metadata, some of which might be translatable. To do this we have to go through a few @@ -41,7 +41,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class AddFieldsToMedia extends Migration +return new class extends Migration { public function up() { @@ -58,7 +58,7 @@ class AddFieldsToMedia extends Migration $table->dropColumn('attribution'); }); } -} +}; ``` And that is all. The most important part is to make sure your migration fields are named the same as your custom metadata values in the twill config. diff --git a/docs/content/2_guides/1_page-builder-with-blade/4_creating-the-page-module.md b/docs/content/2_guides/1_page-builder-with-blade/4_creating-the-page-module.md index e8616efde..c601d79f3 100644 --- a/docs/content/2_guides/1_page-builder-with-blade/4_creating-the-page-module.md +++ b/docs/content/2_guides/1_page-builder-with-blade/4_creating-the-page-module.md @@ -129,7 +129,7 @@ We can see that `Route::module('pages');` has been added to `routes/twill.php`. This is automatic, because it is simple enough to do. -The `routes/twill.php` file is a Twill specific list of routes. These routes are protected and loaded specifically for +The `routes/twill.php` file is a Twill specific list of routes. These routes are protected and loaded specifically for the CMS. In standard Laravel there is no `module` method on a `Route` object, this is something Twill provides and it will build @@ -139,7 +139,7 @@ many routes for your module, these are then used by the cms, controllers and req The second step, we have to do ourself. So let's open `app/Providers/AppServiceProvider.php`. -We will not go into detail about what a service provider is, for that you can check the +We will not go into detail about what a service provider is, for that you can check the [official documentation](https://laravel.com/docs/10.x/providers). In our `boot` method we will add the suggested snippet: @@ -214,14 +214,14 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreatePagesTables extends Migration +return new class extends Migration { public function up() { Schema::create('pages', function (Blueprint $table) { // this will create an id, a "published" column, and soft delete and timestamps columns createDefaultTableFields($table); - + // add those 2 columns to enable publication timeframe fields // (you can use publish_start_date only if you don't need to provide the ability to specify an end date) // $table->timestamp('publish_start_date')->nullable(); @@ -250,7 +250,7 @@ class CreatePagesTables extends Migration Schema::dropIfExists('page_slugs'); Schema::dropIfExists('pages'); } -} +}; ``` This file will create the minimum required tables and columns that Twill uses to provide the CMS functionality. Later in diff --git a/docs/content/2_guides/1_page-builder-with-blade/5_configuring-the-page-module.md b/docs/content/2_guides/1_page-builder-with-blade/5_configuring-the-page-module.md index 8d741fa12..4ef2cc896 100644 --- a/docs/content/2_guides/1_page-builder-with-blade/5_configuring-the-page-module.md +++ b/docs/content/2_guides/1_page-builder-with-blade/5_configuring-the-page-module.md @@ -55,8 +55,8 @@ Refresh the page and you now see that the slug is cleaned up. These changes do not affect how the model's slug is stored in the database, it just changes the visual representation of it. -Model slugs are always saved purely based on the content you enter. If you enter 'example' in the url field when -creating or editing the model, that is what will be saved. +Model slugs are always saved purely based on the content you enter. If you enter 'example' in the url field when +creating or editing the model, that is what will be saved. The front-end is always responsible for handling the slugs. :::#alert::: @@ -166,7 +166,6 @@ class Page extends Model public $translatedAttributes = [ 'title', 'description', - 'active', ]; public $slugAttributes = [ diff --git a/docs/content/2_guides/1_page-builder-with-blade/8_building-a-front-end.md b/docs/content/2_guides/1_page-builder-with-blade/8_building-a-front-end.md index 854e2a1fd..1eb532f28 100644 --- a/docs/content/2_guides/1_page-builder-with-blade/8_building-a-front-end.md +++ b/docs/content/2_guides/1_page-builder-with-blade/8_building-a-front-end.md @@ -108,7 +108,7 @@ Route::get('{slug}', [\App\Http\Controllers\PageDisplayController::class, 'show' ``` As you can see, we create a **get** route, that has **{slug}** as uri. Our second argument is our callable. This we -could have also written as 'PageDisplayController::show'. However, by using a proper namespace, it is easier to follow. +could have also written as 'PageDisplayController@show'. However, by using a proper namespace, it is easier to follow. Once you save this file, head to your browser and visit: `https://your-local-domain.test/example` diff --git a/docs/content/2_guides/1_page-builder-with-blade/9_adding-navigation.md b/docs/content/2_guides/1_page-builder-with-blade/9_adding-navigation.md index 2d5cf2529..88c16e18a 100644 --- a/docs/content/2_guides/1_page-builder-with-blade/9_adding-navigation.md +++ b/docs/content/2_guides/1_page-builder-with-blade/9_adding-navigation.md @@ -62,7 +62,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateMenuLinksTables extends Migration +return new class extends Migration { public function up() { @@ -83,7 +83,7 @@ class CreateMenuLinksTables extends Migration { Schema::dropIfExists('menu_links'); } -} +}; ``` Now you can run the migration: `php artisan migrate` @@ -223,7 +223,7 @@ use App\Models\MenuLink; class MenuLinkRepository extends ModuleRepository { protected $relatedBrowsers = ['page']; - + use HandleNesting; public function __construct(MenuLink $model) @@ -367,7 +367,7 @@ We will change the contents of `resources/views/components/menu.blade.php` to th ``` We add just a minimal amount of styling as we will not spend too much time on that during this guide. But this will -build a navigation tree that is slightly indented so that you can see the proper structure. +build a navigation tree that is slightly indented so that you can see the proper structure. You cannot see it in action yet, for that we have to add the component to the main template file. @@ -389,7 +389,7 @@ But, for this guide, we will simply open `resources/views/site/page.blade.php` a -
+
{!! $item->renderBlocks() !!}
@@ -402,4 +402,3 @@ Wherever you will put `` it will render the menu. That's useful because Now that we have pages and a menu, we have one last thing we need to do. [We need a frontpage](./10_setup-the-frontpage.md)! - diff --git a/docs/content/2_guides/building_a_multilingual_site_with_twill_and_laravel_localization/Article.php b/docs/content/2_guides/building_a_multilingual_site_with_twill_and_laravel_localization/Article.php index 4fd675f60..fcb0df381 100644 --- a/docs/content/2_guides/building_a_multilingual_site_with_twill_and_laravel_localization/Article.php +++ b/docs/content/2_guides/building_a_multilingual_site_with_twill_and_laravel_localization/Article.php @@ -22,7 +22,6 @@ class Article extends Model implements LocalizedUrlRoutable public $translatedAttributes = [ 'title', 'description', - 'active', ]; public $slugAttributes = [ diff --git a/docs/content/2_guides/json_repeaters/migration.php b/docs/content/2_guides/json_repeaters/migration.php index b5dfa23d3..ffdc24ede 100644 --- a/docs/content/2_guides/json_repeaters/migration.php +++ b/docs/content/2_guides/json_repeaters/migration.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateProjectsTables extends Migration +return new class extends Migration { public function up() { @@ -20,4 +20,4 @@ public function down() { Schema::dropIfExists('projects'); } -} +}; diff --git a/docs/content/2_guides/manage_frontend_user_profiles_from_twill/2021_08_01_204153_create_profiles_tables.php b/docs/content/2_guides/manage_frontend_user_profiles_from_twill/2021_08_01_204153_create_profiles_tables.php index 0bf3b3757..ddd516d88 100644 --- a/docs/content/2_guides/manage_frontend_user_profiles_from_twill/2021_08_01_204153_create_profiles_tables.php +++ b/docs/content/2_guides/manage_frontend_user_profiles_from_twill/2021_08_01_204153_create_profiles_tables.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreateProfilesTables extends Migration +return new class extends Migration { public function up() { @@ -27,4 +27,4 @@ public function down() { Schema::dropIfExists('profiles'); } -} +}; diff --git a/docs/content/2_guides/prefill-block-editor-from-template/2021_09_19_131244_create_articles_tables.php b/docs/content/2_guides/prefill-block-editor-from-template/2021_09_19_131244_create_articles_tables.php index fc7c8fcd6..962843c97 100644 --- a/docs/content/2_guides/prefill-block-editor-from-template/2021_09_19_131244_create_articles_tables.php +++ b/docs/content/2_guides/prefill-block-editor-from-template/2021_09_19_131244_create_articles_tables.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreateArticlesTables extends Migration +return new class extends Migration { public function up() { @@ -31,4 +31,4 @@ public function down() Schema::dropIfExists('article_slugs'); Schema::dropIfExists('articles'); } -} +}; diff --git a/examples/basic-page-builder/app/Models/Page.php b/examples/basic-page-builder/app/Models/Page.php index 21db59c12..b3d871f86 100644 --- a/examples/basic-page-builder/app/Models/Page.php +++ b/examples/basic-page-builder/app/Models/Page.php @@ -22,7 +22,6 @@ class Page extends Model public $translatedAttributes = [ 'title', 'description', - 'active', ]; public $slugAttributes = [ diff --git a/examples/portfolio/app/Models/Partner.php b/examples/portfolio/app/Models/Partner.php index 94899fe56..5e551a386 100644 --- a/examples/portfolio/app/Models/Partner.php +++ b/examples/portfolio/app/Models/Partner.php @@ -22,7 +22,6 @@ class Partner extends Model public $translatedAttributes = [ 'title', 'description', - 'active', ]; public $slugAttributes = [ diff --git a/examples/portfolio/app/Models/Project.php b/examples/portfolio/app/Models/Project.php index 0c397476c..dcd58e92e 100644 --- a/examples/portfolio/app/Models/Project.php +++ b/examples/portfolio/app/Models/Project.php @@ -25,7 +25,6 @@ class Project extends Model public $translatedAttributes = [ 'title', 'description', - 'active', ]; public $slugAttributes = [ diff --git a/examples/portfolio/database/migrations/2022_04_01_071515_create_projects_tables.php b/examples/portfolio/database/migrations/2022_04_01_071515_create_projects_tables.php index 5fe3bdc39..286ed5125 100644 --- a/examples/portfolio/database/migrations/2022_04_01_071515_create_projects_tables.php +++ b/examples/portfolio/database/migrations/2022_04_01_071515_create_projects_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateProjectsTables extends Migration +return new class extends Migration { public function up(): void { @@ -34,4 +34,4 @@ public function down(): void Schema::dropIfExists('project_slugs'); Schema::dropIfExists('projects'); } -} +}; diff --git a/examples/portfolio/database/migrations/2022_04_01_071748_create_partners_tables.php b/examples/portfolio/database/migrations/2022_04_01_071748_create_partners_tables.php index ce252962c..43a144647 100644 --- a/examples/portfolio/database/migrations/2022_04_01_071748_create_partners_tables.php +++ b/examples/portfolio/database/migrations/2022_04_01_071748_create_partners_tables.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreatePartnersTables extends Migration +return new class extends Migration { public function up(): void { @@ -44,4 +44,4 @@ public function down(): void Schema::dropIfExists('partner_slugs'); Schema::dropIfExists('partners'); } -} +}; diff --git a/examples/portfolio/database/migrations/2022_04_06_070334_create_comments_tables.php b/examples/portfolio/database/migrations/2022_04_06_070334_create_comments_tables.php index b963b6ced..f44c5bb9c 100644 --- a/examples/portfolio/database/migrations/2022_04_06_070334_create_comments_tables.php +++ b/examples/portfolio/database/migrations/2022_04_06_070334_create_comments_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateCommentsTables extends Migration +return new class extends Migration { public function up(): void { @@ -21,4 +21,4 @@ public function down(): void { Schema::dropIfExists('comments'); } -} +}; diff --git a/examples/portfolio/database/migrations/2022_05_30_074255_create_links_tables.php b/examples/portfolio/database/migrations/2022_05_30_074255_create_links_tables.php index beb4de0e9..fb86e5ffe 100644 --- a/examples/portfolio/database/migrations/2022_05_30_074255_create_links_tables.php +++ b/examples/portfolio/database/migrations/2022_05_30_074255_create_links_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateLinksTables extends Migration +return new class extends Migration { public function up(): void { @@ -23,4 +23,4 @@ public function down(): void { Schema::dropIfExists('links'); } -} +}; diff --git a/examples/tests-browsers/database/migrations/2021_08_10_0001_create_writers_tables_for_browsers.php b/examples/tests-browsers/database/migrations/2021_08_10_0001_create_writers_tables_for_browsers.php index d6a7e1aac..f21c7ee6a 100644 --- a/examples/tests-browsers/database/migrations/2021_08_10_0001_create_writers_tables_for_browsers.php +++ b/examples/tests-browsers/database/migrations/2021_08_10_0001_create_writers_tables_for_browsers.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreateWritersTablesForBrowsers extends Migration +return new class extends Migration { public function up() { @@ -23,4 +23,4 @@ public function down() Schema::dropIfExists('writer_revisions'); Schema::dropIfExists('writers'); } -} +}; diff --git a/examples/tests-browsers/database/migrations/2021_08_10_0002_create_letters_tables_for_browsers.php b/examples/tests-browsers/database/migrations/2021_08_10_0002_create_letters_tables_for_browsers.php index 693d980a7..7a2d9567a 100644 --- a/examples/tests-browsers/database/migrations/2021_08_10_0002_create_letters_tables_for_browsers.php +++ b/examples/tests-browsers/database/migrations/2021_08_10_0002_create_letters_tables_for_browsers.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreateLettersTablesForBrowsers extends Migration +return new class extends Migration { public function up() { @@ -23,4 +23,4 @@ public function down() Schema::dropIfExists('letter_revisions'); Schema::dropIfExists('letters'); } -} +}; diff --git a/examples/tests-browsers/database/migrations/2021_08_10_0003_create_letter_writer_table_for_browsers.php b/examples/tests-browsers/database/migrations/2021_08_10_0003_create_letter_writer_table_for_browsers.php index ba00654a5..d8dca0446 100644 --- a/examples/tests-browsers/database/migrations/2021_08_10_0003_create_letter_writer_table_for_browsers.php +++ b/examples/tests-browsers/database/migrations/2021_08_10_0003_create_letter_writer_table_for_browsers.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreateLetterWriterTableForBrowsers extends Migration +return new class extends Migration { public function up() { @@ -19,4 +19,4 @@ public function down() { Schema::dropIfExists('letter_writer'); } -} +}; diff --git a/examples/tests-browsers/database/migrations/2021_08_10_0004_create_bios_tables_for_browsers.php b/examples/tests-browsers/database/migrations/2021_08_10_0004_create_bios_tables_for_browsers.php index ddae868c6..fbe05f284 100644 --- a/examples/tests-browsers/database/migrations/2021_08_10_0004_create_bios_tables_for_browsers.php +++ b/examples/tests-browsers/database/migrations/2021_08_10_0004_create_bios_tables_for_browsers.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreateBiosTablesForBrowsers extends Migration +return new class extends Migration { public function up() { @@ -25,4 +25,4 @@ public function down() Schema::dropIfExists('bio_revisions'); Schema::dropIfExists('bios'); } -} +}; diff --git a/examples/tests-browsers/database/migrations/2021_08_10_0005_create_books_tables_for_browsers.php b/examples/tests-browsers/database/migrations/2021_08_10_0005_create_books_tables_for_browsers.php index e299b6392..a7cfe1113 100644 --- a/examples/tests-browsers/database/migrations/2021_08_10_0005_create_books_tables_for_browsers.php +++ b/examples/tests-browsers/database/migrations/2021_08_10_0005_create_books_tables_for_browsers.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreateBooksTablesForBrowsers extends Migration +return new class extends Migration { public function up() { @@ -23,4 +23,4 @@ public function down() Schema::dropIfExists('book_revisions'); Schema::dropIfExists('books'); } -} +}; diff --git a/examples/tests-capsules/app/Twill/Capsules/Homepages/Models/Homepage.php b/examples/tests-capsules/app/Twill/Capsules/Homepages/Models/Homepage.php index 8dc98363a..00f90cd24 100644 --- a/examples/tests-capsules/app/Twill/Capsules/Homepages/Models/Homepage.php +++ b/examples/tests-capsules/app/Twill/Capsules/Homepages/Models/Homepage.php @@ -9,7 +9,7 @@ use A17\Twill\Models\Behaviors\HasRevisions; use A17\Twill\Models\Model; -class Homepage extends Model +class Homepage extends Model { use HasBlocks, HasTranslation, HasMedias, HasFiles, HasRevisions; @@ -18,11 +18,10 @@ class Homepage extends Model 'title', 'description', ]; - + public $translatedAttributes = [ 'title', 'description', - 'active', ]; - + } diff --git a/examples/tests-capsules/app/Twill/Capsules/Homepages/database/migrations/2023_01_02_082723_create_homepages_tables.php b/examples/tests-capsules/app/Twill/Capsules/Homepages/database/migrations/2023_01_02_082723_create_homepages_tables.php index 5a338b398..db7a694f5 100644 --- a/examples/tests-capsules/app/Twill/Capsules/Homepages/database/migrations/2023_01_02_082723_create_homepages_tables.php +++ b/examples/tests-capsules/app/Twill/Capsules/Homepages/database/migrations/2023_01_02_082723_create_homepages_tables.php @@ -4,14 +4,14 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateHomepagesTables extends Migration +return new class extends Migration { public function up() { Schema::create('homepages', function (Blueprint $table) { // this will create an id, a "published" column, and soft delete and timestamps columns createDefaultTableFields($table); - + // add those 2 columns to enable publication timeframe fields (you can use publish_start_date only if you don't need to provide the ability to specify an end date) // $table->timestamp('publish_start_date')->nullable(); // $table->timestamp('publish_end_date')->nullable(); @@ -34,4 +34,4 @@ public function down() Schema::dropIfExists('homepage_translations'); Schema::dropIfExists('homepages'); } -} +}; diff --git a/examples/tests-capsules/app/Twill/Capsules/Posts/Models/Post.php b/examples/tests-capsules/app/Twill/Capsules/Posts/Models/Post.php index d3d3a8c49..8e2aa4967 100644 --- a/examples/tests-capsules/app/Twill/Capsules/Posts/Models/Post.php +++ b/examples/tests-capsules/app/Twill/Capsules/Posts/Models/Post.php @@ -24,7 +24,7 @@ class Post extends Model implements Sortable protected $fillable = ['published', 'title', 'description', 'position']; - public $translatedAttributes = ['title', 'description', 'active']; + public $translatedAttributes = ['title', 'description']; public $slugAttributes = ['title']; diff --git a/examples/tests-capsules/app/Twill/Capsules/Posts/database/migrations/2020_08_14_205624_create_posts_tables.php b/examples/tests-capsules/app/Twill/Capsules/Posts/database/migrations/2020_08_14_205624_create_posts_tables.php index 7fa20ae38..3745cb386 100644 --- a/examples/tests-capsules/app/Twill/Capsules/Posts/database/migrations/2020_08_14_205624_create_posts_tables.php +++ b/examples/tests-capsules/app/Twill/Capsules/Posts/database/migrations/2020_08_14_205624_create_posts_tables.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreatePostsTables extends Migration +return new class extends Migration { public function up() { @@ -40,4 +40,4 @@ public function down() Schema::dropIfExists('post_slugs'); Schema::dropIfExists('posts'); } -} +}; diff --git a/examples/tests-deep-nested/database/migrations/2022_11_25_113826_create_clients_tables.php b/examples/tests-deep-nested/database/migrations/2022_11_25_113826_create_clients_tables.php index fba902deb..78066c01c 100644 --- a/examples/tests-deep-nested/database/migrations/2022_11_25_113826_create_clients_tables.php +++ b/examples/tests-deep-nested/database/migrations/2022_11_25_113826_create_clients_tables.php @@ -4,35 +4,29 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateClientsTables extends Migration +return new class extends Migration { public function up() { Schema::create('clients', function (Blueprint $table) { // this will create an id, a "published" column, and soft delete and timestamps columns createDefaultTableFields($table); - + // feel free to modify the name of this column, but title is supported by default (you would need to specify the name of the column Twill should consider as your "title" column in your module controller if you change it) $table->string('title', 200)->nullable(); // your generated model and form include a description field, to get you started, but feel free to get rid of it if you don't need it $table->text('description')->nullable(); - + // add those 2 columns to enable publication timeframe fields (you can use publish_start_date only if you don't need to provide the ability to specify an end date) // $table->timestamp('publish_start_date')->nullable(); // $table->timestamp('publish_end_date')->nullable(); }); - - - - - - } public function down() { - + Schema::dropIfExists('clients'); } -} +}; diff --git a/examples/tests-deep-nested/database/migrations/2022_11_25_114216_create_client_projects_tables.php b/examples/tests-deep-nested/database/migrations/2022_11_25_114216_create_client_projects_tables.php index 47d9beac1..08841fd4b 100644 --- a/examples/tests-deep-nested/database/migrations/2022_11_25_114216_create_client_projects_tables.php +++ b/examples/tests-deep-nested/database/migrations/2022_11_25_114216_create_client_projects_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateClientProjectsTables extends Migration +return new class extends Migration { public function up() { @@ -36,4 +36,4 @@ public function down() Schema::dropIfExists('client_projects'); } -} +}; diff --git a/examples/tests-deep-nested/database/migrations/2022_11_25_114233_create_client_project_applications_tables.php b/examples/tests-deep-nested/database/migrations/2022_11_25_114233_create_client_project_applications_tables.php index d437a8ae0..76d7efc28 100644 --- a/examples/tests-deep-nested/database/migrations/2022_11_25_114233_create_client_project_applications_tables.php +++ b/examples/tests-deep-nested/database/migrations/2022_11_25_114233_create_client_project_applications_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateClientProjectApplicationsTables extends Migration +return new class extends Migration { public function up() { @@ -23,17 +23,10 @@ public function up() // $table->timestamp('publish_start_date')->nullable(); // $table->timestamp('publish_end_date')->nullable(); }); - - - - - - } public function down() { - Schema::dropIfExists('client_project_applications'); } -} +}; diff --git a/examples/tests-modules/app/Models/Author.php b/examples/tests-modules/app/Models/Author.php index 8b74db720..c37b445e1 100644 --- a/examples/tests-modules/app/Models/Author.php +++ b/examples/tests-modules/app/Models/Author.php @@ -53,7 +53,7 @@ class Author extends Model implements Sortable ]; // uncomment and modify this as needed if you use the HasTranslation trait - public $translatedAttributes = ['name', 'description', 'active', 'bio']; + public $translatedAttributes = ['name', 'description', 'bio']; // uncomment and modify this as needed if you use the HasSlug trait public $slugAttributes = ['name']; diff --git a/examples/tests-modules/app/Models/Category.php b/examples/tests-modules/app/Models/Category.php index 04b945402..1343a1f33 100644 --- a/examples/tests-modules/app/Models/Category.php +++ b/examples/tests-modules/app/Models/Category.php @@ -22,7 +22,7 @@ class Category extends Model protected $fillable = ['published', 'title', 'description', 'position']; // uncomment and modify this as needed if you use the HasTranslation trait - public $translatedAttributes = ['title', 'active']; + public $translatedAttributes = ['title']; // uncomment and modify this as needed if you use the HasSlug trait public $slugAttributes = ['title']; diff --git a/examples/tests-modules/database/migrations/2021_10_17_174613_create_categories_tables.php b/examples/tests-modules/database/migrations/2021_10_17_174613_create_categories_tables.php index 4079f165f..70d0c8190 100644 --- a/examples/tests-modules/database/migrations/2021_10_17_174613_create_categories_tables.php +++ b/examples/tests-modules/database/migrations/2021_10_17_174613_create_categories_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class CreateCategoriesTables extends Migration +return new class extends Migration { public function up() { @@ -54,4 +54,4 @@ public function down() Schema::dropIfExists('categories'); } -} +}; diff --git a/examples/tests-modules/database/migrations/2021_10_18_193753_create_authors_tables.php b/examples/tests-modules/database/migrations/2021_10_18_193753_create_authors_tables.php index 66c498b68..a445889c9 100644 --- a/examples/tests-modules/database/migrations/2021_10_18_193753_create_authors_tables.php +++ b/examples/tests-modules/database/migrations/2021_10_18_193753_create_authors_tables.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreateAuthorsTables extends Migration +return new class extends Migration { public function up() { @@ -75,4 +75,4 @@ public function down() Schema::dropIfExists('authors'); } -} +}; diff --git a/examples/tests-modules/database/migrations/2022_05_25_083741_create_revision_limited_contents_tables.php b/examples/tests-modules/database/migrations/2022_05_25_083741_create_revision_limited_contents_tables.php index b2189636f..280bdede4 100644 --- a/examples/tests-modules/database/migrations/2022_05_25_083741_create_revision_limited_contents_tables.php +++ b/examples/tests-modules/database/migrations/2022_05_25_083741_create_revision_limited_contents_tables.php @@ -4,20 +4,20 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateRevisionLimitedContentsTables extends Migration +return new class extends Migration { public function up() { Schema::create('revision_limiteds', function (Blueprint $table) { // this will create an id, a "published" column, and soft delete and timestamps columns createDefaultTableFields($table); - + // feel free to modify the name of this column, but title is supported by default (you would need to specify the name of the column Twill should consider as your "title" column in your module controller if you change it) $table->string('title', 200)->nullable(); // your generated model and form include a description field, to get you started, but feel free to get rid of it if you don't need it $table->text('description')->nullable(); - + // add those 2 columns to enable publication timeframe fields (you can use publish_start_date only if you don't need to provide the ability to specify an end date) // $table->timestamp('publish_start_date')->nullable(); // $table->timestamp('publish_end_date')->nullable(); @@ -33,4 +33,4 @@ public function down() Schema::dropIfExists('revision_limited_revisions'); Schema::dropIfExists('revision_limited'); } -} +}; diff --git a/examples/tests-nestedmodules/database/migrations/2021_09_16_230238_create_nodes_tables.php b/examples/tests-nestedmodules/database/migrations/2021_09_16_230238_create_nodes_tables.php index da96b095e..c28fc42bd 100644 --- a/examples/tests-nestedmodules/database/migrations/2021_09_16_230238_create_nodes_tables.php +++ b/examples/tests-nestedmodules/database/migrations/2021_09_16_230238_create_nodes_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateNodesTables extends Migration +return new class extends Migration { public function up() { @@ -25,4 +25,4 @@ public function down() { Schema::dropIfExists('nodes'); } -} +}; diff --git a/examples/tests-permissions/database/migrations/2021_07_20_132405_create_postings_tables.php b/examples/tests-permissions/database/migrations/2021_07_20_132405_create_postings_tables.php index c7932f527..e6352e6ba 100644 --- a/examples/tests-permissions/database/migrations/2021_07_20_132405_create_postings_tables.php +++ b/examples/tests-permissions/database/migrations/2021_07_20_132405_create_postings_tables.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -class CreatePostingsTables extends Migration +return new class extends Migration { public function up() { @@ -18,4 +18,4 @@ public function down() { Schema::dropIfExists('postings'); } -} +}; diff --git a/examples/tests-singleton/app/Models/ContactPage.php b/examples/tests-singleton/app/Models/ContactPage.php index 03082bdae..92c3c336c 100644 --- a/examples/tests-singleton/app/Models/ContactPage.php +++ b/examples/tests-singleton/app/Models/ContactPage.php @@ -23,7 +23,6 @@ class ContactPage extends Model public $translatedAttributes = [ 'title', 'description', - 'active', ]; public $slugAttributes = [ diff --git a/examples/tests-singleton/database/migrations/2021_09_30_202102_create_contact_pages_tables.php b/examples/tests-singleton/database/migrations/2021_09_30_202102_create_contact_pages_tables.php index 6718170fc..128057f9f 100644 --- a/examples/tests-singleton/database/migrations/2021_09_30_202102_create_contact_pages_tables.php +++ b/examples/tests-singleton/database/migrations/2021_09_30_202102_create_contact_pages_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateContactPagesTables extends Migration +return new class extends Migration { public function up() { @@ -34,4 +34,4 @@ public function down() Schema::dropIfExists('contact_page_slugs'); Schema::dropIfExists('contact_pages'); } -} +}; diff --git a/examples/tests-subdomain-routing/app/Models/Page.php b/examples/tests-subdomain-routing/app/Models/Page.php index 0034aa851..f36252e78 100644 --- a/examples/tests-subdomain-routing/app/Models/Page.php +++ b/examples/tests-subdomain-routing/app/Models/Page.php @@ -22,17 +22,16 @@ class Page extends Model implements Sortable 'description', 'position', ]; - + public $translatedAttributes = [ 'title', 'description', - 'active', ]; - + public $slugAttributes = [ 'title', ]; - + public $mediasParams = [ 'cover' => [ 'default' => [ diff --git a/examples/tests-subdomain-routing/database/migrations/2022_08_17_112843_create_pages_tables.php b/examples/tests-subdomain-routing/database/migrations/2022_08_17_112843_create_pages_tables.php index bb875ef3d..c59238cfc 100644 --- a/examples/tests-subdomain-routing/database/migrations/2022_08_17_112843_create_pages_tables.php +++ b/examples/tests-subdomain-routing/database/migrations/2022_08_17_112843_create_pages_tables.php @@ -4,16 +4,16 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreatePagesTables extends Migration +return new class extends Migration { public function up() { Schema::create('pages', function (Blueprint $table) { // this will create an id, a "published" column, and soft delete and timestamps columns createDefaultTableFields($table); - + $table->integer('position')->unsigned()->nullable(); - + // add those 2 columns to enable publication timeframe fields (you can use publish_start_date only if you don't need to provide the ability to specify an end date) // $table->timestamp('publish_start_date')->nullable(); // $table->timestamp('publish_end_date')->nullable(); @@ -41,4 +41,4 @@ public function down() Schema::dropIfExists('page_slugs'); Schema::dropIfExists('pages'); } -} +}; diff --git a/frontend/icons-wysiwyg/wysiwyg_align_center.svg b/frontend/icons-wysiwyg/wysiwyg_align_center.svg new file mode 100644 index 000000000..b173b8e65 --- /dev/null +++ b/frontend/icons-wysiwyg/wysiwyg_align_center.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/icons-wysiwyg/wysiwyg_align_justify.svg b/frontend/icons-wysiwyg/wysiwyg_align_justify.svg new file mode 100644 index 000000000..317cd938c --- /dev/null +++ b/frontend/icons-wysiwyg/wysiwyg_align_justify.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/icons-wysiwyg/wysiwyg_align_left.svg b/frontend/icons-wysiwyg/wysiwyg_align_left.svg new file mode 100644 index 000000000..6cacc8436 --- /dev/null +++ b/frontend/icons-wysiwyg/wysiwyg_align_left.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/icons-wysiwyg/wysiwyg_align_right.svg b/frontend/icons-wysiwyg/wysiwyg_align_right.svg new file mode 100644 index 000000000..4d1a3d409 --- /dev/null +++ b/frontend/icons-wysiwyg/wysiwyg_align_right.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/js/components/ConnectorField.vue b/frontend/js/components/ConnectorField.vue index e53a07e2e..58fb89ffc 100755 --- a/frontend/js/components/ConnectorField.vue +++ b/frontend/js/components/ConnectorField.vue @@ -105,6 +105,10 @@ subChild.componentInstance.destroyValue() } }) + } else if ( + child.componentInstance.destroyValue + ) { + child.componentInstance.destroyValue() } }) } diff --git a/frontend/js/components/Cropper.vue b/frontend/js/components/Cropper.vue index 5759146f5..781462def 100644 --- a/frontend/js/components/Cropper.vue +++ b/frontend/js/components/Cropper.vue @@ -181,7 +181,21 @@ }, initCrop: function () { const crop = this.toNaturalCrop(this.crop) - this.cropper.setData(crop) + // Mike (mike@area17.com) -- + // + // it seems due to rounding errors(?) that sometimes + // the x position can be reset incorrectly + // see: https://github.com/fengyuanchen/cropperjs/issues/1057 + // + // from my testing it seems to be a little inconsistent and unpredictable + // I guess you just need for the rounding error to happen + // But, it seems setting the properties individually avoids this... + // + // -- Mike (mike@area17.com) + this.cropper.setData({ x: crop.x }) + this.cropper.setData({ y: crop.y }) + this.cropper.setData({ width: crop.width }) + this.cropper.setData({ height: crop.height }) }, test: function () { const crop = this.toNaturalCrop({ x: 0, y: 0, width: 380, height: 475 }) diff --git a/frontend/js/components/DatePicker.vue b/frontend/js/components/DatePicker.vue index 4fa287e0b..736e6c192 100644 --- a/frontend/js/components/DatePicker.vue +++ b/frontend/js/components/DatePicker.vue @@ -172,11 +172,13 @@ }, onClose: function (selectedDates, dateStr, instance) { - self.$emit('input', dateStr) - self.$emit('close', dateStr) + self.$nextTick(function () { // wait for the datepicker to properly update the UI + self.$emit('input', self.date) + self.$emit('close', self.date) - // see formStore mixin - self.saveIntoStore() + // see formStore mixin + self.saveIntoStore() + }) } } diff --git a/frontend/js/components/Filter.vue b/frontend/js/components/Filter.vue index 905c56dbc..7469f493a 100755 --- a/frontend/js/components/Filter.vue +++ b/frontend/js/components/Filter.vue @@ -180,7 +180,7 @@ div { display:inline-block; - button, a { + button:not(.button--validate), a{ vertical-align: middle; } diff --git a/frontend/js/components/VSelect.vue b/frontend/js/components/VSelect.vue index 37f4029f2..38d0c034c 100755 --- a/frontend/js/components/VSelect.vue +++ b/frontend/js/components/VSelect.vue @@ -39,13 +39,12 @@