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.
pixelfed/app/Models/Page.php

59 lines
2.1 KiB
PHTML

8 years ago
<?php
namespace App\Models;
8 years ago
use Illuminate\Database\Eloquent\Model;
4 days ago
use Illuminate\Support\Carbon;
8 years ago
4 days ago
/**
* @property int $id
* @property string|null $root
* @property string|null $slug
* @property string|null $title
* @property int|null $category_id
* @property string|null $content
* @property string $template
* @property int $active
* @property int $cached
* @property string|null $active_until
4 days ago
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
4 days ago
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereActiveUntil($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereCached($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereCategoryId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereContent($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereRoot($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereTemplate($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Page whereUpdatedAt($value)
4 days ago
*
4 days ago
* @mixin \Eloquent
*/
8 years ago
class Page extends Model
{
const SLUG_ROOT = [
9 months ago
'site',
'page',
8 years ago
];
protected $guarded = [];
8 years ago
public function url()
{
9 months ago
return url($this->slug);
8 years ago
}
public function editUrl()
{
9 months ago
return url('/i/admin/settings/pages/edit?page='.urlencode($this->slug));
8 years ago
}
}