PHP code example of guava / filament-modal-relation-managers
1. Go to this page and download the library: Download guava/filament-modal-relation-managers 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/ */
guava / filament-modal-relation-managers example snippets
use Guava\FilamentModalRelationManagers\Concerns\CanBeEmbeddedInModals;
class LessonsRelationManager extends RelationManager
{
use CanBeEmbeddedInModals;
// ...
}
use Guava\FilamentModalRelationManagers\Actions\RelationManagerAction;
// for example in a resource table
public CourseResorce extends Resource {
// ...
public static function table(Table $table): Table
{
return $table
->actions([
RelationManagerAction::make('lesson-relation-manager')
->label('View lessons')
->relationManager(LessonRelationManager::make());
])
// ...
;
}
// ...
}
js
export default {
//...
content: [
// ...
'./vendor/guava/filament-modal-relation-managers/resources/**/*.blade.php',
]
}