PHP code example of afea / filament-files
1. Go to this page and download the library: Download afea/filament-files 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/ */
afea / filament-files example snippets
->plugin(\Afea\Cms\Files\Filament\FilesPlugin::make())
use Afea\Cms\Files\Models\File;
$brochures = File::query()->active()->inGroup('brochures')->ordered()->get();
// each file resolves to either a media URL or an external link
foreach ($brochures as $file) {
$file->url(); // string|null
}