2019-12-23 06:13:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Newsroom extends Model
|
|
|
|
{
|
|
|
|
protected $table = 'newsroom';
|
|
|
|
protected $fillable = ['title'];
|
|
|
|
|
|
|
|
protected $dates = ['published_at'];
|
|
|
|
|
|
|
|
public function permalink()
|
|
|
|
{
|
|
|
|
$year = $this->published_at->year;
|
|
|
|
$month = $this->published_at->format('m');
|
|
|
|
$slug = $this->slug;
|
|
|
|
|
|
|
|
return url("/site/newsroom/{$year}/{$month}/{$slug}");
|
|
|
|
}
|
2019-12-24 06:13:03 +00:00
|
|
|
|
|
|
|
public function editUrl()
|
|
|
|
{
|
|
|
|
return url("/i/admin/newsroom/edit/{$this->id}");
|
|
|
|
}
|
2019-12-23 06:13:49 +00:00
|
|
|
}
|