1 | <?php |
||
8 | class Template extends Model |
||
9 | { |
||
10 | protected $guarded = ['id']; |
||
11 | protected $table = 'form_templates'; |
||
12 | |||
13 | /** |
||
14 | * Apply a template |
||
15 | * |
||
16 | * @return \SoufieneSlimi\LaravelFormTemplate\Models\Template |
||
17 | */ |
||
18 | public function apply() |
||
24 | |||
25 | /** |
||
26 | * Create a new template using an array |
||
27 | * |
||
28 | * @param string $name the template name |
||
29 | * @param array $data the template data |
||
30 | * |
||
31 | * @return void |
||
32 | */ |
||
33 | public static function make(string $name, array $data, $modelFqn = null) |
||
41 | |||
42 | /** |
||
43 | * Create a new template using a model instance |
||
44 | * |
||
45 | * @param string $name the template name |
||
46 | * @param \Illuminate\Database\Eloquent\Model $model the model to extract data from |
||
47 | * @param array $extra [optional] any extra data to save with this |
||
48 | * template |
||
49 | * @param bool $withDefaultExcluded [optional] whether to remove some default data |
||
50 | * from the model or not |
||
51 | * |
||
52 | * @return \SoufieneSlimi\LaravelFormTemplate\Models\Template |
||
53 | */ |
||
54 | public static function makeForModel(string $name, Model $model, array $extra = [], bool $withDefaultExcluded = true) |
||
65 | } |
||
66 |