示例#1
0
 /**
  * Run our own hydration stuffs
  * @return boolean
  */
 public function hydrate()
 {
     parent::hydrate();
     $attributeSetModel = App::make(static::$model)->find($this->currentId);
     $attributeSetModel->attributes()->sync(Input::get('assigned_attributes', []));
     return true;
 }
示例#2
0
 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();
 }
示例#3
0
 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();
 }
示例#4
0
 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();
 }
示例#5
0
 /**
  * Run our own hydration stuffs
  * @return boolean
  */
 public function hydrate()
 {
     parent::hydrate();
     $categoryModel = App::make(static::$model)->find($this->currentId);
     $categoryModel->setMainImage(Input::get('mainImage'));
     $categoryModel->setThumbnailImage(Input::get('thumbnailImage'));
     $categoryModel->setGalleryImages(Input::get('hideFromGallery'));
     $categoryModel->setCollectionImages(Input::get('collectionImages'));
     // Ensure that the product images that need to be deleted get deleted
     $uploadModel = App::make('Davzie\\ProductCatalog\\Upload');
     $uploadModel->deleteById(Input::get('deleteImage'));
     return true;
 }
示例#6
0
 public function __construct($currentId)
 {
     $this->setCurrentId($currentId);
     static::$rules['email'] = 'required|email|unique:users,email,' . $currentId . '|max:255';
     parent::__construct();
 }
示例#7
0
 public function __construct()
 {
     // Default Data
     static::$defaultData['slug'] = Str::slug(Input::get('name'), '-');
     parent::__construct();
 }