Skip to content

Commit

Permalink
Add slug to categories
Browse files Browse the repository at this point in the history
Forgot to give categories a slug before, so this adds it. While
we're at it, we'll remove vim's swapfiles from the repo too.
  • Loading branch information
dshoreman committed Oct 10, 2014
1 parent f12756a commit ec9bb25
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
vendor/
*.swp
*.swo
Binary file removed models/.Product.php.swp
Binary file not shown.
4 changes: 4 additions & 0 deletions models/category/columns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ columns:
title:
label: Title
searchable: true
slug:
label: Slug
searchable: false
description:
label: Description
searchable: false
invisible: true
7 changes: 7 additions & 0 deletions models/category/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file removed models/product/.columns.yaml.swp
Binary file not shown.
1 change: 1 addition & 0 deletions updates/create_categories_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit ec9bb25

Please sign in to comment.