Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
configure-secure-storage
configure-secure-storage
alizharb/agent-skills
claude-code
filesystem-disks
file-uploads
signed-urls
access-control
s3
storage-security

Use when setting up file uploads, configuring private/public disks, and serving sensitive document URLs.

Install
php artisan boost:add-skill alizharb/agent-skills

Save this content to: .claude/skills/configure-secure-storage/SKILL.md

# Configure Secure Storage

## When To Use

Use this skill when implementing avatar uploads, invoice attachments, document storage, or configuring AWS S3/minio disks.

## Workflow

1. **Verify disk rules**: Ensure disk driver config is defined in `config/filesystems.php`.
2. **Access Control check**: Never use the `public` disk for documents that require authentication/authorization policies.
3. **Generate temporary URL**: Serve private documents using temporary URLs (`Storage::temporaryUrl()`).
4. **Clean files**: Clean up orphaned or failed file uploads via event-based disk cleanup jobs.

## Examples

### Good Example

```php
// app/Actions/GenerateInvoiceDownloadUrl.php
namespace App\Actions;

use Illuminate\Support\Facades\Storage;
use App\Models\Invoice;

final readonly class GenerateInvoiceDownloadUrl
{
    public function handle(Invoice $invoice): string
    {
        // Serve secure link valid for 10 minutes only
        return Storage::disk('s3-private')->temporaryUrl(
            $invoice->file_path,
            now()->addMinutes(10)
        );
    }
}
```

### Bad Example

```php
// ❌ Storing private client documents in public directory where anyone can guess the URL.
$file->move(public_path('invoices'), $file->getClientOriginalName());
```

Configure Secure Storage

When To Use

Use this skill when implementing avatar uploads, invoice attachments, document storage, or configuring AWS S3/minio disks.

Workflow

  1. Verify disk rules: Ensure disk driver config is defined in config/filesystems.php.
  2. Access Control check: Never use the public disk for documents that require authentication/authorization policies.
  3. Generate temporary URL: Serve private documents using temporary URLs (Storage::temporaryUrl()).
  4. Clean files: Clean up orphaned or failed file uploads via event-based disk cleanup jobs.

Examples

Good Example

// app/Actions/GenerateInvoiceDownloadUrl.php
namespace App\Actions;

use Illuminate\Support\Facades\Storage;
use App\Models\Invoice;

final readonly class GenerateInvoiceDownloadUrl
{
    public function handle(Invoice $invoice): string
    {
        // Serve secure link valid for 10 minutes only
        return Storage::disk('s3-private')->temporaryUrl(
            $invoice->file_path,
            now()->addMinutes(10)
        );
    }
}

Bad Example

// ❌ Storing private client documents in public directory where anyone can guess the URL.
$file->move(public_path('invoices'), $file->getClientOriginalName());
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource