Skip to content

Protected vs private in service provider #303

@verot

Description

@verot

Would it be possible to set all the methods from BootstrapperL5ServiceProvider to be protected instead of private?

If so, we can then extend the service provider with something like this:

<?php namespace App\Services\Html;

class FormServiceProvider extends \Bootstrapper\BootstrapperL5ServiceProvider {

    /**
     * Register the form builder instance.
     *
     * @return void
     */
    protected function registerFormBuilder()
    {
        $this->app->bindShared(
            'illuminate::html',
            function ($app) {
                return new \Illuminate\Html\HtmlBuilder($app->make('url'));
            }
        );
        $this->app->bindShared(
            'bootstrapper::form',
            function ($app) {
                $form = new FormBuilder(
                    $app->make('illuminate::html'),
                    $app->make('url'),
                    $app['session.store']->getToken()
                );

                return $form->setSessionStore($app['session.store']);
            },
            true
        );
    }
}

alongside this:

<?php namespace App\Services\Html;

class FormBuilder extends \Bootstrapper\Form {

    /**
     * Create a submit button element.
     */
    public function submit($value = null, $options = [])
    {
        // ...
        return parent::submit($value, $options);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions