public function form(Status $status)
    {
        return $this->form->of('work-orders.statuses', function (FormGrid $form) use ($status) {
            if ($status->exists) {
                $method = 'PATCH';
                $url = route('maintenance.work-orders.statuses.update', [$status->getKey()]);
                $form->submit = 'Save';
            } else {
                $method = 'POST';
                $url = route('maintenance.work-orders.statuses.store', [$status->getKey()]);
                $form->submit = 'Create';
            }

            $colors = config('maintenance.colors', []);

            $form->with($status);

            $form->attributes(compact('method', 'url'));

            $form->fieldset(function (Fieldset $fieldset) use ($colors) {
                $fieldset
                    ->control('input:text', 'name')
                    ->attributes([
                        'placeholder' => 'ex. Awaiting Parts / Supplies',
                    ]);

                $fieldset
                    ->control('select', 'color')
                    ->options($colors)
                    ->value(function (Status $status) {
                        return $status->color;
                    })
                    ->attributes([
                        'class' => 'select2-color',
                    ]);
            });
        });
    }
public function form(Status $status)
    {
        return $this->form->of('work-orders.statuses', function (FormGrid $form) use ($status) {
            if ($status->exists) {
                $method = 'PATCH';
                $url = route('maintenance.work-orders.statuses.update', [$status->getKey()]);
                $form->submit = 'Save';
            } else {
                $method = 'POST';
                $url = route('maintenance.work-orders.statuses.store', [$status->getKey()]);
                $form->submit = 'Create';
            }

            $colors = config('maintenance.colors', []);

            $form->with($status);

            $form->attributes(compact('method', 'url'));

            $form->fieldset(function (Fieldset $fieldset) use ($colors) {
                $fieldset
                    ->control('input:text', 'name')
                    ->attributes([
                        'placeholder' => 'ex. Awaiting Parts / Supplies',
                    ]);

                $fieldset
                    ->control('select', 'color')
                    ->options($colors)
                    ->value(function (Status $status) {
                        return $status->color;
                    })
                    ->attributes([
                        'class' => 'select2-color',
                    ]);
            });
        });
    }
public function form ( Status $ status ) { return $ this -> form -> of ( 'work-orders.statuses' , function ( FormGrid $ form ) use ( $ status ) { if ( $ status -> exists ) { $ method = 'PATCH' ; $ url = route ( 'maintenance.work-orders.statuses.update' , [ $ status -> getKey ( ) ] ) ; $ form -> submit = 'Save' ; } else { $ method = 'POST' ; $ url = route ( 'maintenance.work-orders.statuses.store' , [ $ status -> getKey ( ) ] ) ; $ form -> submit = 'Create' ; } $ colors = config ( 'maintenance.colors' , [ ] ) ; $ form -> with ( $ status ) ; $ form -> attributes ( compact ( 'method' , 'url' ) ) ; $ form -> fieldset ( function ( Fieldset $ fieldset ) use ( $ colors ) { $ fieldset -> control ( 'input:text' , 'name' ) -> attributes ( [ 'placeholder' => 'ex. Awaiting Parts / Supplies' , ] ) ; $ fieldset -> control ( 'select' , 'color' ) -> options ( $ colors ) -> value ( function ( Status $ status ) { return $ status -> color ; } ) -> attributes ( [ 'class' => 'select2-color' , ] ) ; } ) ; } ) ; }
Returns a new form of the specified status.

@param Status $status

@return \Orchestra\Contracts\Html\Builder
Returns a new form of the specified status .