Manage Media Assets
Upload files to the Media Library, keep them organized in folders, and render them in Blade templates with responsive image support.
Step 1: Upload Files
- Navigate to Media Library in the Admin sidebar.
- Drag & drop files directly into the browser, or click the Upload button.
- Kompass automatically generates multiple sizes and converts images to WebP and AVIF formats for faster loading.
Step 2: Organize with Folders
As your site grows, keep assets organized:
- Click New Folder.
- Give it a name (e.g.,
blog-headers). - Select files and use the Move action to place them inside the folder.
Step 3: Use Media in Blocks
When you use an "Image" field in a custom block, clicking it opens the Media Library.
- Select your desired image.
- Kompass stores the file ID.
In your Blade template, use the x-image component to render it with full responsive support:
blade
@php
$imageId = get_field('image', $item->datafield);
@endphp
@if($imageId)
<x-image :id="$imageId" class="w-full h-auto rounded" />
@endifStep 4: Troubleshooting Large Uploads
PHP Upload Limits
If you encounter errors when uploading large files, adjust your server's PHP configuration:
- Locate your
php.inifile. - Increase the following values:ini
upload_max_filesize = 20M post_max_size = 20M - Restart your web server (Nginx/Apache).
- Ensure your Livewire configuration (
config/livewire.php) also allows the desired file size in theruleskey.