mirror of https://github.com/movim/movim
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
562 B
31 lines
562 B
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DraftEmbed extends Model
|
|
{
|
|
protected $table = 'embeds';
|
|
|
|
public function draft()
|
|
{
|
|
return $this->belongsTo(Draft::class);
|
|
}
|
|
|
|
public function getHTMLIdAttribute()
|
|
{
|
|
return cleanupId('embed'.$this->id);
|
|
}
|
|
|
|
public function resolve(?int $timeout = 30): ?Url
|
|
{
|
|
try {
|
|
return Url::resolve($this->url, $timeout);
|
|
} catch (\Exception $e) {
|
|
error_log($e->getMessage());
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|