Skip to content

Commit

Permalink
update config document
Browse files Browse the repository at this point in the history
  • Loading branch information
streamtw committed Feb 17, 2017
1 parent 32c0af0 commit f80d662
Showing 1 changed file with 73 additions and 35 deletions.
108 changes: 73 additions & 35 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,76 @@
In `config/lfm.php` :

```php
/*
|--------------------------------------------------------------------------
| Routing
|--------------------------------------------------------------------------
*/

// Include to pre-defined routes from package or not. Middlewares
'use_package_routes' => true,

// Middlewares which should be applied to all package routes.
// For laravel 5.1 and before, remove 'web' from the array.
'middlewares' => ['web','auth'],

// The url to this package. Change it if necessary.
'prefix' => 'laravel-filemanager',

/*
|--------------------------------------------------------------------------
| Multi-User Mode
|--------------------------------------------------------------------------
*/

// If true, private folders will be created for each signed-in user.
'allow_multi_user' => true,

// The database column to identify a user. Make sure the value is unique.
// Ex: When set to 'id', the private folder of user will be named as the user id.
'user_field' => 'id',

/*
|--------------------------------------------------------------------------
| Working Directory
|--------------------------------------------------------------------------
*/

// Which folder to store files in project, fill in 'public', 'resources', 'storage' and so on.
// You should create routes to serve images if it is not set to public.
'base_directory' => 'public',

'images_folder_name' => 'photos',
'files_folder_name' => 'files',

'shared_folder_name' => 'shares',
'thumb_folder_name' => 'thumbs',

/*
|--------------------------------------------------------------------------
| Startup Views
|--------------------------------------------------------------------------
*/

// The default display type for items.
// Supported: "grid", "list"
'images_startup_view' => 'grid',
'files_startup_view' => 'list',

/*
|--------------------------------------------------------------------------
| Upload / Validation
|--------------------------------------------------------------------------
*/

// If true, the uploaded file will be renamed to uniqid() + file extension.
'rename_file' => false,
'rename_file' => false,

// If rename_file set to false and this set to true, then non-alphanumeric characters in filename will be replaced.
'alphanumeric_filename' => true,
// If true, non-alphanumeric folder name will not be allowed.
'alphanumeric_directory' => false,

'use_package_routes' => true,

// For laravel 5.1, please set to ['auth']
'middlewares' => ['web','auth'],

// Add prefix for routes
'prefix' => 'laravel-filemanager',

// Allow multi_user mode or not.
// If true, laravel-filemanager create private folders for each signed-in user.
'allow_multi_user' => true,

// The database field to identify a user.
// When set to 'id', the private folder will be named as the user id.
// NOTE: make sure to use an unique field.
'user_field' => 'id',

'base_directory' => 'public',

'images_folder_name' => 'photos',
'files_folder_name' => 'files',

'shared_folder_name' => 'shares',
'thumb_folder_name' => 'thumbs',

// When choosing a startup view you can fill either 'grid' or 'list'.
'images_startup_view' => 'list',
'files_startup_view' => 'list',
// If true, non-alphanumeric folder name will be rejected.
'alphanumeric_directory' => false,

'max_image_size' => 500,
'max_file_size' => 1000,
Expand All @@ -68,8 +102,13 @@ In `config/lfm.php` :
'text/plain',
],

// file extensions array, only for showing file information, it won't affect the upload process.
'file_type_array' => [
/*
|--------------------------------------------------------------------------
| File Extension Information
|--------------------------------------------------------------------------
*/

'file_type_array' => [
'pdf' => 'Adobe Acrobat',
'doc' => 'Microsoft Word',
'docx' => 'Microsoft Word',
Expand All @@ -84,8 +123,7 @@ In `config/lfm.php` :
'pptx' => 'Microsoft PowerPoint',
],

// file extensions array, only for showing icons, it won't affect the upload process.
'file_icon_array' => [
'file_icon_array' => [
'pdf' => 'fa-file-pdf-o',
'doc' => 'fa-file-word-o',
'docx' => 'fa-file-word-o',
Expand Down

0 comments on commit f80d662

Please sign in to comment.