B8f7a improve templates pages for seo (#5)

* 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>
This commit is contained in:
Chirag
2022-10-03 00:08:41 +05:30
committed by GitHub
parent 9f9da5aed8
commit 36bc081f8f
21 changed files with 669 additions and 9 deletions

32
app/Models/Template.php Normal file
View File

@@ -0,0 +1,32 @@
<?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);
}
}