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.
29 lines
515 B
29 lines
515 B
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DraftEmbed extends Model
|
|
{
|
|
protected $table = 'embeds';
|
|
|
|
public function draft()
|
|
{
|
|
return $this->belongsTo('App\Draft');
|
|
}
|
|
|
|
public function getHTMLIdAttribute()
|
|
{
|
|
return cleanupId('embed'.$this->id);
|
|
}
|
|
|
|
public function resolve()
|
|
{
|
|
try {
|
|
return (new \App\Url)->resolve($this->url);
|
|
} catch (\Exception $e) {
|
|
error_log($e->getMessage());
|
|
}
|
|
}
|
|
}
|