*/
public function getFileName()
{
- if (str_contains($this->name, '.')) {
+ if (strpos($this->name, '.') !== false) {
return $this->name;
}
return $this->name . '.' . $this->extension;
/**
* Get the page this file was uploaded to.
- * @return Page
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function page()
{
if ($this->external && strpos($this->path, 'http') !== 0) {
return $this->path;
}
- return baseUrl('/attachments/' . $this->id);
+ return url('/attachments/' . $this->id);
}
}