Created
January 8, 2017 00:24
-
-
Save matthewtrask/3a921c6066425d05c1ad2377775abbe8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static function boot() | |
{ | |
parent::boot(); | |
static::deleting( | |
function ($model) { | |
if (!empty($model->image_file_name)) { | |
dispatch(new RemoveAssetJob($model)); | |
} | |
} | |
); | |
} | |
/** | |
* Save path on the asset disk | |
* | |
* @return string | |
*/ | |
public function savePath(): string | |
{ | |
return "editorial_content_posts/hero/{$this->id}-{$this->hero_fingerprint}/"; | |
} | |
/** | |
* Admin Edit Link | |
* | |
* @return string | |
*/ | |
public function adminEditLink(): string | |
{ | |
return "/admin/editorial/posts/{$this->id}/edit"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment