noartem

laravel-filesystem-uploads

by @noartem in Tools
1
0
# Install this skill:
npx skills add noartem/skills --skill "laravel-filesystem-uploads"

Install specific skill from multi-skill repository

# Description

Store and serve files via Storage; set visibility, generate URLs, and handle streaming safely

# SKILL.md


name: laravel-filesystem-uploads
description: Store and serve files via Storage; set visibility, generate URLs, and handle streaming safely


Filesystem Uploads and URLs

Use the Storage facade consistently; abstract away the backend (local, S3, etc.).

Commands

$path = Storage::disk('public')->putFile('avatars', $request->file('avatar'));

// Temporary URLs (S3, etc.)
$url = Storage::disk('s3')->temporaryUrl($path, now()->addMinutes(10));

// Streams
return Storage::disk('backups')->download('db.sql.gz');

Patterns

  • Keep user uploads under a dedicated disk with explicit visibility
  • Avoid assuming local paths; always go through Storage
  • For public assets, run storage:link and serve via web server / CDN
  • Validate mime/types and size limits at upload boundaries

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.