Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs on customizing Blueprint and Fieldset repositories. #1159

Open
joshuablum opened this issue Dec 8, 2023 · 0 comments
Open

Add docs on customizing Blueprint and Fieldset repositories. #1159

joshuablum opened this issue Dec 8, 2023 · 0 comments

Comments

@joshuablum
Copy link
Member

Like doing something like this in our AppServiceProvider for Fieldsets:

$this->app->singleton(\Statamic\Fields\FieldsetRepository::class, function () {
  return (new \Statamic\Fields\FieldsetRepository)
    // define the path here
    ->setDirectory(resource_path('fieldsets'));
});

or this for Blueprints:

$this->app->bind(\Statamic\Fields\BlueprintRepository::class, function () {
  return (new \Statamic\Fields\BlueprintRepository)
    ->setDirectory(resource_path('blueprints'))
    ->setFallback('default', function () {
      return \Statamic\Facades\Blueprint::makeFromFields([
        'content' => ['type' => 'markdown', 'localizable' => true],
      ]);
    });
});

Took statamic/cms#8344 for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants