PHP code example of darmshot / filament-nested-resources

1. Go to this page and download the library: Download darmshot/filament-nested-resources library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

darmshot / filament-nested-resources example snippets


use Darmshot\FilamentNestedResources\Columns\ChildResourceLink;
use Darmshot\FilamentNestedResources\NestedResource;

class ChildModelResource extends NestedResource
{
    public static function getParent(): string
    {
        return ParentModelResource::class;
    }
}

use Darmshot\FilamentNestedResources\ResourcePages\NestedCreatePage;
use Darmshot\FilamentNestedResources\ResourcePages\NestedEditPage;
use Darmshot\FilamentNestedResources\ResourcePages\NestedListPage;

public static function table(Table $table): Table
{
    return $table
        ->columns([
            ChildResourceLink::make(ChildModelResource::class),
        ]);
}

public static function form(Form $form, ?Event $parent = null): Form;