Skip to content

Commit

Permalink
chore: added missing installation info to readme and addded demo proj…
Browse files Browse the repository at this point in the history
…ect link

Signed-off-by: Lukas Frey <[email protected]>
  • Loading branch information
lukas-frey committed Apr 25, 2024
1 parent 70ef751 commit 8b38fb1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Artist would be the root resource, the other would be child resources.
### Supported relationships
Currently we support **one-to-many** and **polymoprhic one-to-many** relationships only.

### Demo Project
To better understand how nested resources work and to troubleshoot any issues you might encounter, we've created a demo laravel project:
https://github.com/GuavaCZ/filament-nested-resources-demo

### Quick start

In order to set up Nested Resources, you need to do these steps:
Expand Down Expand Up @@ -160,7 +164,7 @@ class ListArtists extends ListRecords
}
```

Now let`s create a new page which will be used to create child records. Let's create `CreateArtistAlbum` page inside `ArtistResource/Pages`:
Now let\`s create a new page which will be used to create child records. Let's create `CreateArtistAlbum` page inside `ArtistResource/Pages`:

```php
use Guava\FilamentNestedResources\Pages\CreateRelatedRecord;
Expand All @@ -170,6 +174,9 @@ class CreateArtistAlbum extends CreateRelatedRecord
{
use NestedPage;

// This page also needs to know the ancestor relationship used (just like relation managers):
protected static string $relationship = 'albums';

//
}
```
Expand Down

0 comments on commit 8b38fb1

Please sign in to comment.