Skip to content
Snippets Groups Projects
PageModel.php 1.62 KiB
Newer Older
  • Learn to ignore specific revisions
  •  * @copyright  2020 Ad Aures
    
     * @license    https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
     * @link       https://castopod.org/
     */
    
    namespace App\Models;
    
    
        protected $allowedFields = ['id', 'title', 'slug', 'content_markdown', 'content_html'];
    
        protected $useSoftDeletes = false;
    
            'title'            => 'required',
            'slug'             => 'required|regex_match[/^[a-zA-Z0-9\-]{1,128}$/]|is_unique[pages.slug,id,{id}]',
    
            'content_markdown' => 'required',
    
    
        /**
         * Before update because slug or title might change
         *
         * @var string[]
         */
    
         * @return array<string, array<string|int, mixed>>
         */
        protected function clearCache(array $data): array
    
            // Clear the cache of all pages