Skip to content

Commit

Permalink
remove docs for registering globals
Browse files Browse the repository at this point in the history
  • Loading branch information
tdwesten authored Oct 30, 2024
1 parent 16918b9 commit 84664d7
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ Field::make('custom_field')
]);
```
## How to register Collections, Taxonomies and Globals
## How to register Collections and Taxonomies
This addon enables you to define collections, taxonomies, and globals in PHP classes, simplifying the process of defining and managing them.
This addon enables you to define collections and taxonomies in PHP classes, simplifying the process of defining and managing them.
### How to register a collection
Expand Down Expand Up @@ -340,41 +340,7 @@ This addon enables you to define collections, taxonomies, and globals in PHP cla
];
```
### How to register a global set
1. Generate a new global set blueprint, for example for a site settings global set blueprint run the following command:
```bash
php artisan make:global-set SiteSettings
```
2. Define your global set in the generated file. For example, the file has all options available to define a global set. For example:
```php
<?php
namespace App\Globals;
use Statamic\Facades\Site;
use Tdwesten\StatamicBuilder\BaseGlobalSet;
class SiteSettings extends BaseGlobalSet
{
/**
* The handle for this global set
*
* Example: return 'footer';
*/
public static function handle(): string
{
return 'site_settings';
}
/**
* The title for this global set
*
* Example: return 'Footer';
*/
public function title(): string
{
return 'Site Settings';
Expand Down

0 comments on commit 84664d7

Please sign in to comment.