Download the PHP package casperlaitw/filesys without Composer
On this page you can find all versions of the php package casperlaitw/filesys. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download casperlaitw/filesys
More information about casperlaitw/filesys
Files in casperlaitw/filesys
Package filesys
Short Description Laravel - Filemanager extension, Fork from crip-laravel/filesys
License MIT
Homepage https://github.com/crip-laravel/filesys
Informations about the package filesys
CRIP Filesystem manager (v.1.2.14)
This package easily integrates filesystem manager in to your website. You can use it with TinyMCE editor or just stand alone popup for your input fields. CRIP Filesys Manager is based on Vue.js framework and is stand alone single page application for your filesystem control on server side.
Manager is using Laravel Filesystem to read and write files on the server side. This means that you can configure your Laravel driver and manager will fit to it. Amazon S3, FTP or local storage - your choice where keep files.
Installation
Require package with composer:
If you are on lower Laravel version that 5.5 (or choose not to use package auto
discovery) add this to ServiceProvider
in configuration file of your Laravel
application config/app.php
:
Copy the package resources and views to your local folders with the publish command:
This allows you to override package resource files by updating them directly from your application: views -
/resources/views/vendor/cripfilesys
and assets in a/public/vendor/crip/cripfilesys
folder.
Additionally you can override package configuration file publishing it to your application config folder:
Filesystem manager is not configured to any of routes and you should do it manually. This allows to ad any middleware and will not conflict with any application routes, as it can be anything you choose.
Add new methods in your app\Providers\RouteServiceProvider.php
Now you can add new routes file to map package controllers tou your application
routes. Create new file routes/package.php
and add content:
Remember - route names for FolderController
and FileController
are important
and should be registered in RouteServiceProvider
boot
method with pattern to
correctly allocate file location in server filesystem.
Configuration
public_url
- Public url to assets folder. By default assets are published to
/vendor/crip/cripfilesys
and this configuration default value
is set to this folder.
public_storage
- This feature may increase application speed, but in this
case files will have public access for everyone, no matter
what. If you choose enable it make sure
symbolic link
is created for your storage directory in case if you use
local/public storage configuration.
absolute_url
- Make urls to a files absolute. Useful when file manager is
located under different domain.
user_folder
- This value is indicates value of the subfolder of currently
configured storage. This may be useful in case if you want each
user or user group to have their own folder - by default single
folder is shared for everyone. This can be done creating
middleware for routes and defining value on application
start-up. Take a look for sample below.
authorization
- This value may be useful if your application is SPA and you do
not use Laravel sessions to identify users. For packages as
JWT you need pass token in a request or may be used Bearer
authorization for API. For web routes you may pass 'token'
property with value and then all API calls will contain Bearer
authorization replacing placeholder with passed token
value in a first request of UI part of filesys manager.
thumbs
- Uploaded images will be sized to this configured Array. First
argument is width
and second is height
. Third argument describes
crop type:
resize
- crop image to width and height;width
- resize the image to a width and constrain aspect ratio (auto height);height
- resize the image to a height and constrain aspect ratio (auto width);
icons.url
- Public url to images folder. By default images are published to
/vendor/crip/cripfilesys/images/
and this configuration default
value is set to this folder.
icons.files
- Mapping array between file mime type name and icon image
([type].png).
mime.types
- Mapping from file full mime type to type name (array).
mime.media
- Mapping between mime type name and media type (array).
mime.map
- Mapping between file extension and media type. Used in cases when
storage may not get mime type (array).
block
- Blocked file extensions and mime types.
actions
- Controller actions to allocate file and directory actions.
Usage
TinyMCE
Download and set up TinyMCE editor. Copy plugins
folder from published resources \public\vendor\crip\cripfilesys\tinymce\plugins
to installed TinyMCE editor plugins
directory. Configure TinyMCE to enable
cripfilesys
plugin in it:
CKEditor
Download and set up CKEditor and configure it to enable
cripfilesys
plugin in it:
Stand-alone filesystem manager
You can use iframe
, FancyBox
or Lightbox
iframe to open the Fylesystem
manager. To handle selected file, add GET parameter to the end of the path:
/packages/filemanager?target=callback
. You can filter visible files by they
type: /packages/filemanager?target=callback&type=[type]
. Supported types are:
document
- excel, word, pwp, html, txt and js;image
- any file with mime type starting fromimage/*
. Additionally you can specify default size of selected image by addingselect
property in a request with value of configured thumb size;media
- audio and video;file
- all files. This type is set by default;
Types could be configured in package configuration file mime.media
section.
To handle filesystem manager selected file url, window object should contain
window.cripFilesystemManager
function witch will be called on file select with
selected file url and all GET parameters of opened window.
Sample
User folder configuration sample
Create new Middleware
app/Http/Middleware/RegisterUserStorageFolder.php
:
In this sample I use user methods
isAdmin
andslug
where one is returning boolean indicating that user belongs to administrators group of my application and other one gets unique slug of user name.
Register new Middleware
app/Http/Kernel.php
:
Then protect your routes
routes/package.php
:
All versions of filesys with dependencies
illuminate/support Version ^10.0|^11.0
intervention/image Version ^3.0
php Version ^8.1|^8.2