Laravel Box

Files

This package provides a clean way of working with files.

To work with files first call ->files() followed by a method.

Get file

Accepts a file id, returns an array.

Box::files()->file($id);

Download file

Accepts a file id Optionally a path can be used when $storeDownload is set to true. To download the file only an id is required.

Box::files()->download($id, $path = '', $storeDownload = false);

Upload file

Accepts a file path and filename. Optionally specify the parent, defaults to 0 when omitted.

Box::files()->upload($path, $name, $parent = 0);

Upload revision

Accepts the file id, file path and filename. Optionally specify a new name.

Box::files()->uploadRevision($file_id, $filepath, $name, $newname = null);

Delete file

Accepts a file id, returns no output.

Box::files()->destroy($id);
Laravel Modules Your Logo Your Logo Your Logo

Become a sponsor

Help support the blog so that I can continue creating new content!

Sponsor

My Latest Book

Modular Laravel Book - Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Subscribe to my newsletter

Subscribe and get my books and product announcements.

Fathom Analytics $10 discount on your first invoice using this link

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.