<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
unexpectedjourney / filament-modal-resource-picker example snippets
use UnexpectedJourney\FilamentResourcePicker\FilamentResourcePickerPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
FilamentResourcePickerPlugin::make(),
])
])
}
use UnexpectedJourney\FilamentResourcePicker\Forms\Components\ResourcePicker;
public static function form(Form $form): Form
{
return $form
->schema([
ResourcePicker::make('component_id')
->resource(ProductResource::class),
]);
}
use UnexpectedJourney\FilamentResourcePicker\Forms\Components\ResourcePicker;
public static function form(Form $form): Form
{
return $form
->schema([
ResourcePicker::make('component_id')
->resource(ProductResource::class)
->multiple(),
]);
}
use UnexpectedJourney\FilamentResourcePicker\Forms\Components\ResourcePicker;
public static function form(Form $form): Form
{
return $form
->schema([
ResourcePicker::make('component_id')
->resource(ProductResource::class)
->multiple()
->sortable(),
]);
}
use UnexpectedJourney\FilamentResourcePicker\Forms\Components\ResourcePicker;
public static function form(Form $form): Form
{
return $form
->schema([
ResourcePicker::make('cross_sell_products')
->resource(ProductResource::class)
->relationship()
->multiple(),
]);
}
use UnexpectedJourney\FilamentResourcePicker\Forms\Components\ResourcePicker;
public static function form(Form $form): Form
{
return $form
->schema([
ResourcePicker::make('cross_sell_products')
->resource(ProductResource::class)
->relationship()
->multiple()
->orderColumn('sort')
]);
}
use UnexpectedJourney\FilamentResourcePicker\Facades\ResourcePickerManager;
public function boot(): void
{
ResourcePickerManager::configure([
ProductResource::class => fn(ResourcePickerConfiguration $configuration) => $configuration,
]);
}
use UnexpectedJourney\FilamentResourcePicker\Facades\ResourcePickerManager;
public function boot(): void
{
ResourcePickerManager::configure([
ProductResource::class => fn(ResourcePickerConfiguration $configuration) => $configuration
->searchColumns([
'name',
'part_number',
'vendor.name',
]),
]);
}
use UnexpectedJourney\FilamentResourcePicker\Facades\ResourcePickerManager;
public function boot(): void
{
ResourcePickerManager::configure([
ProductResource::class => fn(ResourcePickerConfiguration $configuration) => $configuration
->previewComponent('products.card.mini')
]);
}
use UnexpectedJourney\FilamentResourcePicker\Livewire\ResourceBrowser;
class CustomResourceBrowser extends esourceBrowser
{
// Add any custom functionality
}
use UnexpectedJourney\FilamentResourcePicker\FilamentResourcePickerPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
FilamentResourcePickerPlugin::make()
->resourceBrowserComponent(CustomResourceBrowser::class),
])
])
}
use \UnexpectedJourney\FilamentResourcePicker\Support\ResourcePickerRenderHook
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.