Download the PHP package mcris112/file-manager-system without Composer
On this page you can find all versions of the php package mcris112/file-manager-system. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mcris112/file-manager-system
More information about mcris112/file-manager-system
Files in mcris112/file-manager-system
Package file-manager-system
Short Description Laravel Package for File System Manager, administrate and get the disk
License MIT
Informations about the package file-manager-system
LARAVEL FILE SYSTEM MANAGER
Laravel File System Manager is a project to upload/view files and retrieve as resource to show it into your frontend file manager interface
If u have some recommendations, please do.
- Author: MCris112
- Vendor: mcris112
- Package: laravel-file-system-manager
- Version:
1.x
- PHP Version: 8.1+
- Laravel Version:
10.x
Table of Contents
- Installation
- Configuration
- Getting Started
- Save a file
- Use a different disk manager
- Functions
- Url
- Manage Size
- Content
- From Base 64
- Collection
- Traits
- Resource
- Customize FmFile resource transformation
- Has an Image
- Has image variations
- FmPagination
- Resource
- Category
- Folder
- Create Folder
- Content
- Search Folders
- Find a Folder
- Folder Parent
- Put into Folder
- Delete folder or content
- File
- Search files
- Find a file
- Avatar
- Before use
- Used
- Url
- Create Avatar
- Folder
Installation
Install the package with the command Composer:
Configuration
Publish the config file
Add/delete the disk driver size that you will use
At Users model, need to add CanViewFmFilePrivate
, this is necessary for check if user can view the current file selected on route '.../storage/{disk}/{path}'
Getting Started
Save a file
Use a different disk manager
Just use the static function disk to change
Functions
Url
Manage Size
Get global information that is set into config and content saved
Get information by specific type of content
Content
Get this to show it into your file manager interface. Get a paginated list of files models that doesn't have a directory as parent
From Base 64
Convert a base64 encoded into a UploadedFile
Collection
When you get a collection of files models, It has a function to use
Traits
Resource
Convert relation at resource to frontend response. Use the trait ResourceFmImageVariationTransformation
to use the function
$this->fmImageVariation()
Before
After
Customize resource transformation
if you want to customize the resource to use in function $this->fmImageVariation()
, just need to change the class in
Has an Image
If you want that a model has an image, you can define that relationship with trait and table
Model
Migration
Has image variations
If has different images variations
FmPagination
Category
Folder
Create Folder
Folder Content
Search Folders
Find a folder
Folder Parent
If you want to create a sub folder, you can define the parent
Put into folder
To save some content inside of folder, just do
Delete folder or content
File
Search Files
Find a File
Why FileSystemManager::folder()->find( $id )
instead of FmFile::find($id)
or FmFile::whereId($id)->get()
, you can use it but in this case will return a full cached model.
Delete file
Why use FileSystemManager::file($file)->delete()
instead of $file->delete()
, in this case, if something happens when It's destroying your file, the record on your db won't be rolled back and It will generate an incorrect sum of storage size
Avatar
Before Use
Config
Dont forget to configure filesystemmanager.php
in case you want to use avatars
Add UserHasAvatar
trait to avoid errors when is null to generate a based name avatar, but if you always will set a file, you can avoid this step
Used
How much storage is the avatar using
Avatar Url
Get the Avatar url from User
Create Avatar
You can define the file, but as same time you can let it as null and It will create an avatar based on name