Files
ABSDEV/Modules/Pages/Models/Page.php
T
Mark Gregory b738ff908b Professional searchable page library.
* Clear Live, Draft and Homepage indicators.
* Direct Edit page, Edit content and View page actions.
* Page editor divided into:
    * Page details
    * SEO and URL
    * Publishing
* Automatic, unique URL slugs.
* Publish and expiry scheduling.
* Page templates: Default, Landing and Full Width.
* Homepage replacement handled automatically.
* Current homepage protected from accidental deletion.
* Page duplication includes its complete content structure.
* Content composer now works from the actual page record and page ID.
* Clearer section-based terminology for editors.
* Reusable content remains available as an advanced content library rather than dominating the workflow.

The package contains the eight complete changed files, preserving their project paths. It is not a patch collection.
2026-07-28 13:35:06 +01:00

36 lines
1.0 KiB
PHP

<?php
namespace Modules\Pages\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Content\Models\PageContent;
use Modules\Localization\Concerns\HasTranslations;
use Modules\Sites\Concerns\BelongsToSites;
use Modules\Workflow\Concerns\HasWorkflow;
final class Page extends Model
{
use BelongsToSites, HasFactory, HasTranslations, HasWorkflow, SoftDeletes;
protected $table = 'pages';
protected $fillable = ['title', 'slug', 'summary', 'content', 'status', 'published_at', 'expires_at', 'template', 'is_home'];
protected function casts(): array
{
return [
'published_at' => 'datetime',
'expires_at' => 'datetime',
'is_home' => 'boolean',
];
}
public function contentPlacements(): HasMany
{
return $this->hasMany(PageContent::class)->orderBy('region')->orderBy('sort_order');
}
}