Skip to content

Instantly share code, notes, and snippets.

@matthewtrask
Created January 8, 2017 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewtrask/3a921c6066425d05c1ad2377775abbe8 to your computer and use it in GitHub Desktop.
Save matthewtrask/3a921c6066425d05c1ad2377775abbe8 to your computer and use it in GitHub Desktop.
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