PHP code example of outerweb / filament-image-library
1. Go to this page and download the library: Download outerweb/filament-image-library 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/ */
outerweb / filament-image-library example snippets
use Outerweb\FilamentImageLibrary\Filament\Plugins\FilamentImageLibraryPlugin;
class FilamentPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
FilamentImageLibraryPlugin::make(),
]);
}
}
use Outerweb\FilamentImageLibrary\Filament\Plugins\FilamentImageLibraryPlugin;
class FilamentPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
FilamentImageLibraryPlugin::make()
->allowedDisks([
'public' => 'Public images',
]),
]);
}
}
use Outerweb\FilamentImageLibrary\Filament\Plugins\FilamentImageLibraryPlugin;
class FilamentPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
FilamentImageLibraryPlugin::make()
->addAllowedDisk('public', 'Public images'),
]);
}
}
use Outerweb\FilamentImageLibrary\Filament\Plugins\FilamentImageLibraryPlugin;
class FilamentPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
FilamentImageLibraryPlugin::make()
->navigationSort(10),
]);
}
}
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image'),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('images')
->multiple(),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image')
->disableUpload(),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image')
->disableExisting(),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image')
->disableImageDeselect(),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image')
->disableImageEdit(),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image')
->disableImageEditBadges(),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('images')
->disableOrderingImages(),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image')
->disableImageCrop(),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image')
->existingItemsPerPage(20),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
use Outerweb\ImageLibrary\Entities\ConversionDefinition;
ImageLibraryPicker::make('image')
->filteredConversionDefinitions([
'thumbnail',
ConversionDefinition::get('16:9'),
]),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
use Outerweb\ImageLibrary\Entities\ConversionDefinition;
ImageLibraryPicker::make('image')
->disabledConversionDefinitions([
'thumbnail',
ConversionDefinition::get('16:9'),
]),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image')
->enablePackageConversionDefinitions(),
use Outerweb\FilamentImageLibrary\Filament\Forms\Components\ImageLibraryPicker;
ImageLibraryPicker::make('image')
->relationOrderColumn('sort_order'),
use Outerweb\FilamentImageLibrary\Filament\Infolists\Components\ImageLibraryEntry;
ImageLibraryEntry::make('image')
->label('Image(s)'),
use Outerweb\FilamentImageLibrary\Filament\Infolists\Components\ImageLibraryEntry;
ImageLibraryEntry::make('seoData.image')
->label('Image(s)'),