protected function bootFormEvents()
    {
        $categoriesCollection = Foundation::make('antares.customfields.model.category')
                        ->select(['name'])->with(['group' => function($query) {
                        $query->select(['name']);
                    }])->get();

        $formHandler      = 'Antares\Customfields\Events\FormHandler';
        $validatorHandler = 'Antares\Customfields\Events\ValidatorHandler';
        $processorHandler = 'Antares\Customfields\Events\ProcessorHandler';


        $categoriesCollection->each(function($category) use($formHandler, $validatorHandler, $processorHandler) {
            $category->group->each(function($group) use($category, $formHandler, $validatorHandler, $processorHandler) {
                $accessor = implode('.', [$category->name, $group->name]);
                $events   = $this->app->make('events');
                $events->listen('antares.form: ' . $accessor, "{$formHandler}@onViewForm");
                $events->listen($accessor . '.customfields.validate', "{$validatorHandler}@onSubmitForm");
                $events->listen('antares.form: ' . $accessor . '.save', "{$processorHandler}@onSave");
            });
        });
    }