Skip to content

Commit

Permalink
Merge pull request #18 from awcodes/FDT2k/main
Browse files Browse the repository at this point in the history
Facade, sort and resource registration
  • Loading branch information
awcodes authored Nov 2, 2022
2 parents 3d46b45 + cb06e78 commit 68a49a0
Show file tree
Hide file tree
Showing 11 changed files with 6,724 additions and 12 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 107 additions & 0 deletions .idea/filament-quick-create.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 101 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,53 @@ Then just add the Resource Classes that you want to exclude.

```php
'exclude' => [
UserResource::class,
\App\Filament\Resources\UserResource::class,
...
]
```

## Retrieving Resources

In a service provider, in the boot method, you can use ```QuickCreate::getResourcesUsing``` to control the retrieved resources. Doing so still excludes resources defined in the config file.
```php
use FilamentQuickCreate\Facades\QuickCreate;

// ....
Filament::serving(function(){
QuickCreate::getResourcesUsing(function(){
return [
PostResource::class,
PageResource::class
];
});
});

```
## Disable sorting

### Using the Facade
```php
use FilamentQuickCreate\Facades\QuickCreate;

// ....
Filament::serving(function(){
QuickCreate::sort(false);
});

```

### Or in the config file

you can disable sorting like so

```php
'exclude' => [
...
],
'sort'=> false
```


## Usage

That's it, after installing the create menu will show up in the filament header next to the global search input.
Loading

0 comments on commit 68a49a0

Please sign in to comment.