I am an idiot. This is totally possible, but I had my service provider order wrong.
This is what I do now:
class AppServiceProvider extends ServiceProvider {
/**
* Register services.
*/
public function register() {
$this->app->singleton(MyFormBuilder::class, function ($app) {
return new MyFormBuilder($app, $app[FormHelper::class], $app['events']);
});
$this->app->alias(MyFormBuilder::class, 'laravel-form-builder');
$this->app->alias(MyFormBuilder::class, 'Kris\LaravelFormBuilder\FormBuilder');
}
}
And that makes every call resolve to my FormBuilder. Injections, app() calls, everything. Perfect.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community