| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,6 +16,7 @@ | |||
| 16 | 16 | "ircmaxell/password-compat": "1.0.*", | |
| 17 | 17 | "filp/whoops": "1.0.1", | |
| 18 | 18 | "monolog/monolog": "1.4.*", | |
| 19 | + "nesbot/carbon": "1.*", | ||
| 19 | 20 | "patchwork/utf8": "1.1.*", | |
| 20 | 21 | "predis/predis": "0.8.*", | |
| 21 | 22 | "swiftmailer/swiftmailer": "4.3.*", | |
@@ -30,8 +31,7 @@ | |||
| 30 | 31 | "symfony/http-kernel": "2.3.*", | |
| 31 | 32 | "symfony/process": "2.3.*", | |
| 32 | 33 | "symfony/routing": "2.3.*", | |
| 33 | - "symfony/translation": "2.3.*", | ||
| 34 | - "nesbot/carbon": "1.*" | ||
| 34 | + "symfony/translation": "2.3.*" | ||
| 35 | 35 | }, | |
| 36 | 36 | "replace": { | |
| 37 | 37 | "illuminate/auth": "self.version", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,7 +87,7 @@ public function getAndResetWheres() | |||
| 87 | 87 | */ | |
| 88 | 88 | public function save(Model $model) | |
| 89 | 89 | { | |
| 90 | - $model->setAttribute($this->morphType, $this->morphClass); | ||
| 90 | + $model->setAttribute($this->getPlainMorphType(), $this->morphClass); | ||
| 91 | 91 | ||
| 92 | 92 | return parent::save($model); | |
| 93 | 93 | } | |
@@ -121,7 +121,7 @@ public function create(array $attributes) | |||
| 121 | 121 | */ | |
| 122 | 122 | protected function getForeignAttributesForCreate() | |
| 123 | 123 | { | |
| 124 | - $foreign = array(last(explode('.', $this->foreignKey)) => $this->parent->getKey()); | ||
| 124 | + $foreign = array($this->getPlainForeignKey() => $this->parent->getKey()); | ||
| 125 | 125 | ||
| 126 | 126 | $foreign[last(explode('.', $this->morphType))] = $this->morphClass; | |
| 127 | 127 | ||
@@ -138,6 +138,16 @@ public function getMorphType() | |||
| 138 | 138 | return $this->morphType; | |
| 139 | 139 | } | |
| 140 | 140 | ||
| 141 | + /** | ||
| 142 | + * Get the plain morph type name without the table. | ||
| 143 | + * | ||
| 144 | + * @return string | ||
| 145 | + */ | ||
| 146 | + public function getPlainMorphType() | ||
| 147 | + { | ||
| 148 | + return last(explode('.', $this->morphType)); | ||
| 149 | + } | ||
| 150 | + | ||
| 141 | 151 | /** | |
| 142 | 152 | * Get the class name of the parent model. | |
| 143 | 153 | * | |
| Back | FazBrowse Home | New Git URL |
0 commit comments