FamilyEventForm::edit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Forms\Builders;
4
5
use App\Models\Family;
6
use App\Models\FamilyEvent;
7
use App\Models\Place;
8
use LaravelEnso\Forms\Services\Form;
9
10
class FamilyEventForm
11
{
12
    protected const TemplatePath = __DIR__.'/../Templates//familyEvent.json';
13
14
    protected Form $form;
15
16
    public function __construct()
17
    {
18
        $this->form = new Form(static::TemplatePath);
19
    }
20
21
    public function create()
22
    {
23
        return $this->form->options('family_id', Family::all())->options('place_id', Place::all())->create();
24
        // return $this->form->options(['family_id' => Family::all(), 'place_id' => Place::all()])->create();
25
    }
26
27
    public function edit(FamilyEvent $familyEvent)
28
    {
29
        return $this->form->options('family_id', Family::all())->options('place_id', Place::all())->edit($familyEvent);
30
        // return $this->form->options(['family_id' => Family::all(), 'place_id' => Place::all()])->edit($familyEvent);
31
    }
32
}
33