mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 00:05:29 +00:00
23 lines
431 B
PHP
23 lines
431 B
PHP
|
<?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}");
|
||
|
}
|
||
|
}
|