PHP code example of digitonic / photonic-filament

1. Go to this page and download the library: Download digitonic/photonic-filament 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/ */

    

digitonic / photonic-filament example snippets


use Digitonic\Photonic\Filament\Concerns\UsesPhotonic;

class Article extends Model
{
    use UsesPhotonic;
}

use Digitonic\Photonic\Filament\Forms\Components\PhotonicImageField;

PhotonicImageField::make();

use Digitonic\Photonic\Filament\Facades\Photonic;
use Digitonic\Photonic\Filament\Enums\PresetEnum;

$url = Photonic::for($mediaIdOrMediaModel)
    ->preset(PresetEnum::ORIGINAL)
    ->url(); // ?string

$media = Photonic::for($mediaIdOrMediaModel)
    ->media(); // ?Media

$info = Photonic::for($mediaIdOrMediaModel)
    ->preset('featured')
    ->info(); // ?PhotonicInfo
bash
php artisan photonic-filament:install
bash
php artisan vendor:publish --tag=photonic-filament-migrations
php artisan migrate
bash
php artisan vendor:publish --tag=photonic-filament-config
php artisan vendor:publish --tag=photonic-filament-views