mirror of
https://github.com/fergalmoran/OpnForm.git
synced 2026-01-11 02:55:16 +00:00
* Templates * access templates without login also * Set required on UI * Improve templates pages for SEO * test case for Templates * Refactor SitemapController * Cosmetic changes to templates Co-authored-by: Julien Nahum <jhumanj@MacBook-Pro-de-Julien.local>
33 lines
635 B
PHP
33 lines
635 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Stevebauman\Purify\Facades\Purify;
|
|
|
|
class Template extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'slug',
|
|
'description',
|
|
'image_url',
|
|
'structure',
|
|
'questions',
|
|
];
|
|
|
|
protected $casts = [
|
|
'structure' => 'array',
|
|
'questions' => 'array',
|
|
];
|
|
|
|
public function setDescriptionAttribute($value)
|
|
{
|
|
// Strip out unwanted html
|
|
$this->attributes['description'] = Purify::clean($value);
|
|
}
|
|
}
|