diff --git a/.gitignore b/.gitignore index 48b8bf9..3dec0e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ vendor/ +*.swp +*.swo diff --git a/models/.Product.php.swp b/models/.Product.php.swp deleted file mode 100644 index 25504c7..0000000 Binary files a/models/.Product.php.swp and /dev/null differ diff --git a/models/category/columns.yaml b/models/category/columns.yaml index 27ce3f6..c2e55a7 100644 --- a/models/category/columns.yaml +++ b/models/category/columns.yaml @@ -9,6 +9,10 @@ columns: title: label: Title searchable: true + slug: + label: Slug + searchable: false description: label: Description searchable: false + invisible: true diff --git a/models/category/fields.yaml b/models/category/fields.yaml index 1ed3807..89b5696 100644 --- a/models/category/fields.yaml +++ b/models/category/fields.yaml @@ -6,6 +6,13 @@ fields: title: label: Title required: true + slug: + label: Slug + required: true + attributes: + data-input-preset: 'input[name="Category[title]"]' + data-input-preset-type: 'slug' + data-input-preset-closest-parent: 'form' description: label: Description type: textarea diff --git a/models/product/.columns.yaml.swp b/models/product/.columns.yaml.swp deleted file mode 100644 index 6660ffc..0000000 Binary files a/models/product/.columns.yaml.swp and /dev/null differ diff --git a/updates/create_categories_table.php b/updates/create_categories_table.php index 1718503..e212932 100644 --- a/updates/create_categories_table.php +++ b/updates/create_categories_table.php @@ -13,6 +13,7 @@ public function up() $table->engine = 'InnoDB'; $table->increments('id'); $table->string('title')->index(); + $table->string('slug')->unique(); $table->string('description')->nullable(); $table->timestamps(); });