Advertisement
Guest User

2018_10_28_035243_snipcart.module.products__create_products_

a guest
Oct 28th, 2018
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.31 KB | None | 0 0
  1. <?php
  2.  
  3. use Anomaly\Streams\Platform\Database\Migration\Migration;
  4.  
  5. class SnipcartModuleProductsCreateProductsFields extends Migration
  6. {
  7.  
  8.     /**
  9.      * The addon fields.
  10.      *
  11.      * @var array
  12.      */
  13.     protected $fields = [
  14.         'name' => 'anomaly.field_type.text',
  15.         'description' => 'anomaly.field_type.text',
  16.         'sku' => [
  17.             'type' => 'anomaly.field_type.slug',
  18.             'config' => [
  19.                 'slugify' => 'name',
  20.                 'type' => '-'
  21.             ],
  22.         ],
  23.         'price'  => [
  24.             "type"   => "anomaly.field_type.decimal",
  25.             "config" => [
  26.                 "min"       => 0
  27.             ]
  28.         ],
  29.         'image' => 'anomaly.field_type.file',
  30.         'tags'  => [
  31.             'type'   => 'anomaly.field_type.tags',
  32.             'config' => [
  33.                 'free_input'    => true
  34.             ]
  35.         ]
  36.     ];
  37.     /**
  38.     * The stream assignments.
  39.     *
  40.     * @var array
  41.     */
  42.     protected $assignments = [
  43.          'name' => [
  44.              'required' => true,
  45.          ],
  46.          'sku' => [
  47.              'unique' => true,
  48.              'required' => true,
  49.          ],
  50.          'price' => [
  51.              'required' => true
  52.          ],
  53.          'description',
  54.          'image',
  55.          'tags',
  56.  ];
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement