PHP code example of innopanda / laravel-asset-manager
1. Go to this page and download the library: Download innopanda/laravel-asset-manager 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/ */
innopanda / laravel-asset-manager example snippets
return [
/*
|--------------------------------------------------------------------------
| Storage Disk
|--------------------------------------------------------------------------
*/
'disk' => env('ASSET_MANAGER_DISK', 'public'),
/*
|--------------------------------------------------------------------------
| Maximum Upload Size
|--------------------------------------------------------------------------
|
| Value is in KB.
|
*/
'max_upload_size' => 10240,
/*
|--------------------------------------------------------------------------
| Allowed MIME Types
|--------------------------------------------------------------------------
*/
'allowed_mime_types' => [
'image/jpeg',
'image/png',
'image/webp',
],
/*
|--------------------------------------------------------------------------
| Tenant Awareness
|--------------------------------------------------------------------------
*/
'tenant_aware' => false,
];
'sync' => [
// Define the root folder in your bucket to scan (default: '/')
// Useful if your bucket is shared with other applications.
'root_path' => env('ASSET_MANAGER_ROOT', '/'),
// Set to true if your S3 bucket is private
'private_urls' => env('ASSET_MANAGER_PRIVATE_URLS', false),
// Duration in minutes for temporary signed URLs
'temporary_url_expiration' => env('ASSET_MANAGER_TEMP_URL_EXPIRES', 60),
],
use Illuminate\Support\Facades\Schedule;
Schedule::command('asset-manager:sync')->hourly();
use Livewire\Attributes\On;
#[On('asset-selected')]
public function updateImage($image)
{
$this->selectedImage = $image;
}
use Innopanda\AssetManager\Filament\Forms\Components\AssetPicker;
AssetPicker::make('image')
->label('Image');