mirror of https://github.com/pixelfed/pixelfed
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			28 lines
		
	
	
		
			532 B
		
	
	
	
		
			PHP
		
	
			
		
		
	
	
			28 lines
		
	
	
		
			532 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}");
 | 
						|
    }
 | 
						|
 | 
						|
    public function editUrl()
 | 
						|
    {
 | 
						|
        return url("/i/admin/newsroom/edit/{$this->id}");
 | 
						|
    }
 | 
						|
}
 |