Skip to content

Commit 214659e

Browse files
committed
update readme
1 parent 8b72b36 commit 214659e

File tree

2 files changed

+70
-48
lines changed

2 files changed

+70
-48
lines changed

README.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
* Fork from [tsawler/laravel-filemanager](http://packalyst.com/packages/package/tsawler/laravel-filemanager)
66
* support public and private folders for multi users
7-
* customizable views and routes
7+
* customizable views, routes and middlewares
88
* supported locales : en, fr(not completed yet), zh-TW, zh-CN
99

1010
## Requirements
1111

12-
This package requires [intervention/image](https://github.com/Intervention/image), in order to make thumbs, crop and resize images.
12+
* php >= 5.5
13+
* Laravel 5 (working to support Laravel 4)
14+
* requires [intervention/image](https://github.com/Intervention/image)(to make thumbs, crop and resize images).
1315

1416
## Installation
1517

@@ -38,9 +40,10 @@ This package requires [intervention/image](https://github.com/Intervention/image
3840
3941
```
4042
php artisan vendor:publish --tag=lfm_config
43+
php artisan vendor:publish --tag=lfm_public
4144
```
4245
43-
1. Fill user_field with a column name in users table as user's slug in `config/lfm.php` :
46+
1. Set user's folder name (with a column name in users table) in `config/lfm.php` :
4447
4548
```
4649
'user_field' => 'name',
@@ -70,31 +73,46 @@ This package requires [intervention/image](https://github.com/Intervention/image
7073
7174
1. Ensure that the files & images directories are writable by your web server
7275
73-
## Customization
76+
## Setting config
7477
75-
1. To use your own route, edit config/lfm.php :
78+
In `config/lfm.php` :
7679
7780
```php
78-
'use_package_routes' => false,
79-
```
81+
'rename_file' => true,
82+
// true : files will be renamed as uniqid
83+
// false : files will remain original names
8084
81-
1. To disable multi-user mechanism, dit config/lfm.php :
85+
'use_package_routes' => true,
86+
// set this to false to customize route for file manager
8287
83-
```php
84-
'allow_multi_user' => false,
85-
```
86-
87-
1. To specify upload directory, edit config/lfm.php :
88+
'middlewares' => ['auth'],
89+
// determine middlewares that apply to all file manager routes
8890
89-
```php
90-
'images_dir' => 'public/photos/',
91-
'images_url' => '/photos/',
91+
'allow_multi_user' => true,
92+
// true : user can upload files to shared folder and their own folder
93+
// false : all files are put together in shared folder
94+
95+
'user_field' => 'name',
96+
// determine which column of users table will be used as user's folder name
97+
98+
'shared_folder_name' => 'shares',
99+
// the name of shared folder
92100
93-
'files_dir' => 'public/files/',
94-
'files_url' => '/files/',
101+
'thumb_folder_name' => 'thumbs',
102+
// the name of thumb folder
103+
104+
'images_dir' => 'public/photos/',
105+
'images_url' => '/photos/',
106+
// path and url of images
107+
108+
'files_dir' => 'public/files/',
109+
'files_url' => '/files/',
110+
// path and url of files
95111
```
96112
97-
1. If the route is changed, make sure `filebrowserImageBrowseUrl` is correspond to your route :
113+
## Customization
114+
115+
1. If the route is changed, make sure urls below is correspond to your route :
98116
99117
```javascript
100118
<script>
@@ -107,4 +125,8 @@ This package requires [intervention/image](https://github.com/Intervention/image
107125
108126
And be sure to include the `?type=Images` or `?type=Files` parameter.
109127
110-
1. To customize the views, copy file from `vendor/unisharp/laravel-filemanager/src/views` to `resources/views/vendor/laravel-filemanager`.
128+
1. To customize the views :
129+
130+
```
131+
cp vendor/unisharp/laravel-filemanager/src/views/* resources/views/vendor/laravel-filemanager/
132+
```

src/config/lfm.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
<?php
22

33
return [
4+
'rename_file' => true,
5+
46
'use_package_routes' => true,
57

6-
'allow_multi_user' => true,
8+
'middlewares' => ['auth'],
79

8-
'rename_file' => true,
10+
'allow_multi_user' => true,
911

1012
'user_field' => 'name',
1113

1214
'shared_folder_name' => 'shares',
1315
'thumb_folder_name' => 'thumbs',
1416

15-
'middlewares' => ['auth'],
16-
1717
'images_dir' => 'public/photos/',
1818
'images_url' => '/photos/',
1919

2020
'files_dir' => 'public/files/',
2121
'files_url' => '/files/',
2222

2323
'file_type_array' => [
24-
"pdf" => "Adobe Acrobat",
25-
"docx" => "Microsoft Word",
26-
"docx" => "Microsoft Word",
27-
"xls" => "Microsoft Excel",
28-
"xls" => "Microsoft Excel",
29-
"zip" => 'Archive',
30-
"gif" => 'GIF Image',
31-
"jpg" => 'JPEG Image',
32-
"jpeg" => 'JPEG Image',
33-
"png" => 'PNG Image',
34-
"ppt" => 'Microsoft PowerPoint',
35-
"pptx" => 'Microsoft PowerPoint',
24+
'pdf' => 'Adobe Acrobat',
25+
'docx' => 'Microsoft Word',
26+
'docx' => 'Microsoft Word',
27+
'xls' => 'Microsoft Excel',
28+
'xls' => 'Microsoft Excel',
29+
'zip' => 'Archive',
30+
'gif' => 'GIF Image',
31+
'jpg' => 'JPEG Image',
32+
'jpeg' => 'JPEG Image',
33+
'png' => 'PNG Image',
34+
'ppt' => 'Microsoft PowerPoint',
35+
'pptx' => 'Microsoft PowerPoint',
3636
],
3737

3838
'file_icon_array' => [
39-
"pdf" => "fa-file-pdf-o",
40-
"docx" => "fa-file-word-o",
41-
"docx" => "fa-file-word-o",
42-
"xls" => "fa-file-excel-o",
43-
"xls" => "fa-file-excel-o",
44-
"zip" => 'fa-file-archive-o',
45-
"gif" => 'fa-file-image-o',
46-
"jpg" => 'fa-file-image-o',
47-
"jpeg" => 'fa-file-image-o',
48-
"png" => 'fa-file-image-o',
49-
"ppt" => 'fa-file-powerpoint-o',
50-
"pptx" => 'fa-file-powerpoint-o',
39+
'pdf' => 'fa-file-pdf-o',
40+
'docx' => 'fa-file-word-o',
41+
'docx' => 'fa-file-word-o',
42+
'xls' => 'fa-file-excel-o',
43+
'xls' => 'fa-file-excel-o',
44+
'zip' => 'fa-file-archive-o',
45+
'gif' => 'fa-file-image-o',
46+
'jpg' => 'fa-file-image-o',
47+
'jpeg' => 'fa-file-image-o',
48+
'png' => 'fa-file-image-o',
49+
'ppt' => 'fa-file-powerpoint-o',
50+
'pptx' => 'fa-file-powerpoint-o',
5151
],
5252
];

0 commit comments

Comments
 (0)