Added the support for generating docs from template doc
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DocumentSetting extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'file_name_pattern',
|
||||
'date_format',
|
||||
'unresolved_policy',
|
||||
'preview_enabled',
|
||||
'whitelist',
|
||||
'date_formats',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'preview_enabled' => 'boolean',
|
||||
'whitelist' => 'array',
|
||||
'date_formats' => 'array',
|
||||
];
|
||||
|
||||
public static function instance(): self
|
||||
{
|
||||
return static::query()->first() ?? static::create([
|
||||
'file_name_pattern' => config('documents.file_name_pattern'),
|
||||
'date_format' => config('documents.date_format'),
|
||||
'unresolved_policy' => config('documents.unresolved_policy'),
|
||||
'preview_enabled' => config('documents.preview.enabled', true),
|
||||
'whitelist' => config('documents.whitelist'),
|
||||
'date_formats' => [],
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user