/** * @param $attachmentData * @return bool */ public function createAttachment($attachmentData) { /*$finalData = $attachmentData-except(array('password')); print_r($finalData);*/ $attachmentModel = parent::getNew($attachmentData); $attachmentModel->slug = str_slug($attachmentData['name'], '-'); if ($attachmentModel->save()) { $this->insertedId = $attachmentModel->id; return true; } return false; }
/** * @param $mediaData * @return bool */ public function createMedia($mediaData) { /*$finalData = $mediaData-except(array('password')); print_r($finalData);*/ $mediaModel = parent::getNew($mediaData); $mediaModel->slug = \Str::slug($mediaData['name'], '-'); if ($mediaModel->save()) { $this->insertedId = $mediaModel->id; return true; } return false; }