Media Library
Complete guide to using LaraDashboard's media library for uploading, organizing, and managing images, documents, and other files.
Media Library
LaraDashboard's Media Library provides a centralized location for managing all your uploaded files including images, documents, videos, and more.
Overview
Accessing the Media Library
Navigate to Media in the sidebar to access the library.
Library Interface
┌─────────────────────────────────────────────────────────────────┐
│ Media Library [Upload] [Search] [Filter]│
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ │ │ │ │ │ │ │ │
│ │ Image │ │ Image │ │ Image │ │ Document│ │
│ │ │ │ │ │ │ │ │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ image1.jpg image2.png photo.jpg report.pdf │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ │ │ │ │ │ │ │ │
│ │ Video │ │ Image │ │ Image │ │ Archive │ │
│ │ │ │ │ │ │ │ │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ video.mp4 banner.jpg logo.svg backup.zip │
│ │
├─────────────────────────────────────────────────────────────────┤
│ Showing 8 of 156 files < 1 2 3 4 5 > │
└─────────────────────────────────────────────────────────────────┘
Uploading Files
Single File Upload
- Click the Upload button
- Select file from your computer
- Wait for upload to complete
- File appears in the library
Bulk Upload
- Click Upload
- Select multiple files (Ctrl/Cmd+click)
- Or use the drag-and-drop zone
- All files upload simultaneously
Drag and Drop
Simply drag files from your computer directly into the library:
- Open the Media Library
- Drag files onto the page
- Drop zone activates
- Release to upload
Upload from URL
Import files from external URLs:
- Click Upload → From URL
- Enter the file URL
- Click Import
- File is downloaded and added
File Types
Supported Formats
| Category | Extensions |
|---|---|
| Images | JPG, JPEG, PNG, GIF, SVG, WebP, ICO |
| Documents | PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX |
| Archives | ZIP, RAR, 7Z, TAR, GZ |
| Video | MP4, MOV, AVI, WebM, MKV |
| Audio | MP3, WAV, OGG, M4A, FLAC |
| Code | JSON, XML, CSV, TXT, MD |
File Size Limits
Default limits (configurable):
| Type | Max Size |
|---|---|
| Images | 10 MB |
| Documents | 20 MB |
| Videos | 100 MB |
| Other | 10 MB |
Checking Upload Limits
Click Upload Limits to see current restrictions:
Maximum File Size: 10 MB
Allowed Types: jpg, png, gif, pdf, mp4...
Available Storage: 4.2 GB / 5 GB
Managing Files
Viewing File Details
Click any file to open the detail panel:
┌─────────────────────────────────────────────┐
│ [Image Preview] │
│ │
│ Filename: hero-banner.jpg │
│ Type: image/jpeg │
│ Size: 245 KB │
│ Dimensions: 1920 x 1080 │
│ Uploaded: Jan 15, 2024 │
│ Uploaded by: Admin │
│ │
│ Alt Text: [________________________] │
│ Caption: [________________________] │
│ │
│ URL: https://site.com/storage/hero.jpg │
│ [Copy URL] │
│ │
│ [Delete] [Download] [Edit] │
└─────────────────────────────────────────────┘
Editing Files
Edit file metadata:
- Click on the file
- Edit fields:
- Alt Text - Accessibility description
- Caption - Display caption
- Title - File title
- Click Save
Deleting Files
Single Delete
- Click file to select
- Click Delete button
- Confirm deletion
Bulk Delete
- Check multiple files
- Click Bulk Actions → Delete
- Confirm deletion
Warning: Deleted files cannot be recovered. Ensure they're not in use.
Downloading Files
- Click file to open details
- Click Download
- File downloads to your computer
Image Processing
Automatic Conversions
When you upload images, LaraDashboard creates:
| Conversion | Size | Use Case |
|---|---|---|
| Thumb | 150x150 | Thumbnails |
| Preview | 300x300 | Previews |
| Medium | 640x640 | General use |
| Large | 1024x1024 | Featured |
Image Optimization
Images are automatically:
- Compressed for web (quality 85%)
- Stripped of EXIF data (configurable)
- Converted to WebP (if supported)
- Responsive srcset generated
Manual Image Editing
Basic editing available:
- Click image → Edit
- Available tools:
- Crop
- Rotate
- Flip
- Resize
Organizing Files
Search
Search files by name:
- Enter keywords in search box
- Results filter in real-time
- Search matches filename and metadata
Filters
Filter by file type:
- All - All files
- Images - Photos and graphics
- Documents - PDFs, docs, spreadsheets
- Video - Video files
- Audio - Audio files
Sorting
Sort files by:
- Date - Newest or oldest first
- Name - Alphabetical
- Size - Largest or smallest
- Type - Grouped by file type
View Options
Toggle between views:
- Grid View - Visual thumbnails
- List View - Detailed list
Using Media in Content
In the Editor
- Place cursor where you want media
- Click the media button in toolbar
- Select from library or upload new
- Configure display options:
- Size (thumbnail, medium, large, full)
- Alignment (left, center, right)
- Link behavior
- Insert into content
As Featured Image
- Edit post/page
- Find Featured Image panel
- Click Set Featured Image
- Select or upload image
- Click Use Image
In LaraBuilder
- Add Image or Gallery block
- Click to configure
- Select from media library
- Adjust settings
File URLs
URL Structure
Files are accessible at:
https://yourdomain.com/storage/media/{file-path}
Getting File URL
- Click on file
- Copy URL from details panel
- Or right-click → Copy URL
Direct Links
Share files directly:
https://yourdomain.com/storage/media/documents/report.pdf
Storage Configuration
Storage Location
Files are stored in:
storage/app/public/media/
Accessible via symlink at:
public/storage/media/
Creating Symlink
If files aren't accessible:
php artisan storage:link
Cloud Storage
Configure S3 or other cloud storage:
- Update
.env:
FILESYSTEM_DISK=s3
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=your-bucket
- Files automatically upload to S3
Permissions
Media Permissions
| Permission | Description |
|---|---|
media.view |
View media library |
media.upload |
Upload new files |
media.edit |
Edit file metadata |
media.delete |
Delete files |
File Ownership
- Files are associated with uploader
- Admins can manage all files
- Users may be restricted to own files
API Access
Listing Media
GET /api/v1/media
Uploading Media
POST /api/v1/media
Content-Type: multipart/form-data
file: (binary)
alt_text: Description
Deleting Media
DELETE /api/v1/media/{id}
See API Reference for complete documentation.
Best Practices
File Naming
- Use descriptive names:
hero-banner-homepage.jpg - Avoid spaces: use hyphens or underscores
- Keep names concise but meaningful
- Include dimensions for images:
logo-200x50.png
Image Optimization
Before uploading:
- Resize to maximum needed size
- Compress using tools like TinyPNG
- Choose appropriate format:
- JPEG - Photos
- PNG - Graphics with transparency
- SVG - Logos and icons
- WebP - Modern format, best compression
Organization Tips
- Upload related files together
- Use consistent naming conventions
- Regularly clean unused files
- Document file purposes in alt text
Performance
- Keep library organized
- Delete unused files
- Use appropriate image sizes
- Leverage automatic conversions
Troubleshooting
Upload Fails
Symptoms: Upload error or timeout
Solutions:
- Check file size against limits
- Verify file type is allowed
- Check server upload limits:
// php.ini upload_max_filesize = 20M post_max_size = 25M - Check storage permissions
Files Not Displaying
Symptoms: Broken image icons
Solutions:
- Run
php artisan storage:link - Check file path in database
- Verify file exists in storage
- Check URL configuration
Missing Thumbnails
Symptoms: Only original shows
Solutions:
- Check image processor (GD/Imagick)
- Verify media-library config
- Regenerate conversions:
php artisan media-library:regenerate
Storage Full
Symptoms: Upload rejected
Solutions:
- Check disk space
- Delete unused files
- Compress existing images
- Upgrade storage
Integration with Spatie Media Library
LaraDashboard uses Spatie Media Library. For advanced usage:
Custom Conversions
// In model
public function registerMediaConversions(Media $media = null): void
{
$this->addMediaConversion('custom')
->width(800)
->height(600)
->sharpen(10);
}
Responsive Images
public function registerMediaConversions(Media $media = null): void
{
$this->addMediaConversion('responsive')
->withResponsiveImages();
}
See Developer Guide for more.
Next Steps
- Content Management - Use media in content
- Email Templates - Add images to emails
- Settings - Configure upload limits