public function __construct($currentId) { $this->setCurrentId($currentId); // Dynamic Rules static::$rules['name'] = 'required|max:255|unique:attribute_sets,name,' . $currentId; parent::__construct(); }
public function __construct($currentId) { $this->setCurrentId($currentId); // Dynamic Rules static::$rules['name'] = 'required|max:255|unique:attributes,name,' . $currentId; static::$defaultData['default'] = Input::get('default'); parent::__construct(); }
public function __construct($currentId) { $this->setCurrentId($currentId); // Dynamic Rules static::$rules['url'] = 'required|alpha_dash|unique:collections,url,' . $currentId; // Default Data static::$defaultData['slug'] = Str::slug(Input::get('name'), '-'); parent::__construct(); }
public function __construct() { // Default Data static::$defaultData['slug'] = Str::slug(Input::get('url'), '-'); // If we have a 0 through on parent ID then we can assume the user has not chosen anything if (Input::get('parent_id') == 0) { unset(static::$rules['parent_id']); static::$defaultData['parent_id'] = null; } parent::__construct(); }
public function __construct($currentId) { $this->setCurrentId($currentId); // Dynamic Rules static::$rules['parent_id'] = 'integer|exists:categories,id|not_in:' . $currentId; static::$rules['url'] = 'required|alpha_dash|unique:categories,url,' . $currentId; // If we have a 0 through on parent ID then we can assume the user has not chosen anything if (Input::get('parent_id') == 0) { unset(static::$rules['parent_id']); static::$defaultData['parent_id'] = null; } // Default Data static::$defaultData['slug'] = Str::slug(Input::get('url'), '-'); static::$defaultData['description'] = Input::get('description'); parent::__construct(); }
public function __construct($currentId) { $this->setCurrentId($currentId); // Dynamic Rules static::$rules['sku'] = 'required|alpha_dash|unique:products,sku,' . $currentId; static::$rules['url'] = 'required|alpha_dash|unique:products,url,' . $currentId; // Default Data static::$defaultData['slug'] = Str::slug(Input::get('sku'), '-'); static::$defaultData['description'] = Input::get('description'); // If we have a 0 through on attribute set ID then we can assume the user has not chosen anything if (Input::get('attribute_set_id') == 0) { unset(static::$rules['attribute_set_id']); static::$defaultData['attribute_set_id'] = null; } if (Input::get('collection_id') == 0) { unset(static::$rules['collection_id']); static::$defaultData['collection_id'] = null; } parent::__construct(); }
public function __construct($currentId) { $this->setCurrentId($currentId); static::$rules['email'] = 'required|email|unique:users,email,' . $currentId . '|max:255'; parent::__construct(); }
public function __construct() { // Default Data static::$defaultData['slug'] = Str::slug(Input::get('name'), '-'); parent::__construct(); }