Skip to content

Commit 8ffe49a

Browse files
committed
update readme and document
1 parent 9715b09 commit 8ffe49a

File tree

7 files changed

+72
-45
lines changed

7 files changed

+72
-45
lines changed

README.md

+6-45
Original file line numberDiff line numberDiff line change
@@ -21,63 +21,24 @@ PR is welcome!
2121
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
2222
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
2323
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
24-
25-
## Upgrade guide
26-
* `composer update unisharp/laravel-filemanager`
27-
* `php artisan vendor:publish --tag=lfm_view --force`
28-
* `php artisan vendor:publish --tag=lfm_config --force` (IMPORTANT: please backup your own `config/lfm.php` first)
24+
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
25+
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
2926

3027
## Screenshots
3128
* Independent usage example :
3229

33-
![Independent usage example](http://unisharp.github.io/images/lfm01.png)
30+
![Independent usage example](https://raw.githubusercontent.com/UniSharp/laravel-filemanager/gh_pages/images/lfm01.png)
3431

3532
* List view :
3633

37-
![FileManager screenshot 1](http://unisharp.com/img/filemanager1.png)
34+
![FileManager screenshot 1](https://raw.githubusercontent.com/UniSharp/laravel-filemanager/gh_pages/images/lfm02.png)
3835

3936
* Grid view :
4037

41-
![FileManager screenshot 2](http://unisharp.com/img/filemanager2.png)
42-
43-
## Events
44-
45-
To use events you can add a listener to listen to the events
46-
47-
Snippet for `EventServiceProvider`
48-
```php
49-
protected $listen = [
50-
ImageWasUploaded::class => [
51-
UploadListener::class,
52-
],
53-
];
54-
```
55-
56-
The `UploadListener` will look like:
57-
```php
58-
class UploadListener
59-
{
60-
public function handle($event)
61-
{
62-
$method = 'on'.class_basename($event);
63-
if (method_exists($this, $method)) {
64-
call_user_func([$this, $method], $event);
65-
}
66-
}
67-
68-
public function onImageWasUploaded(ImageWasUploaded $event)
69-
{
70-
$path = $event->path();
71-
//your code, for example resizing and cropping
72-
}
73-
}
74-
```
75-
76-
List of events:
77-
* Unisharp\Laravelfilemanager\Events\ImageWasUploaded
38+
![FileManager screenshot 2](https://raw.githubusercontent.com/UniSharp/laravel-filemanager/gh_pages/images/lfm03.png)
7839

7940
## Credits
80-
* All contibutors from GitHub. (issues / PR)
41+
* [All contibutors](https://github.com/UniSharp/laravel-filemanager/graphs/contributors) from GitHub. (issues / PR)
8142
* Special thanks to
8243
* [@taswler](https://github.com/tsawler) the original author.
8344
* [@olivervogel](https://github.com/olivervogel) for the awesome [image library](https://github.com/Intervention/image)

doc/config.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
55
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
66
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
7+
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
8+
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
79

810
## Config
911

doc/customization.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
55
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
66
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
7+
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
8+
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
79

810
## Customization
911

doc/events.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Documents
2+
3+
1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md)
4+
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
5+
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
6+
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
7+
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
8+
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
9+
10+
## List of events
11+
* Unisharp\Laravelfilemanager\Events\ImageWasUploaded
12+
13+
## How to use
14+
15+
To use events you can add a listener to listen to the events
16+
17+
Snippet for `EventServiceProvider`
18+
```php
19+
protected $listen = [
20+
ImageWasUploaded::class => [
21+
UploadListener::class,
22+
],
23+
];
24+
```
25+
26+
The `UploadListener` will look like:
27+
```php
28+
class UploadListener
29+
{
30+
public function handle($event)
31+
{
32+
$method = 'on'.class_basename($event);
33+
if (method_exists($this, $method)) {
34+
call_user_func([$this, $method], $event);
35+
}
36+
}
37+
38+
public function onImageWasUploaded(ImageWasUploaded $event)
39+
{
40+
$path = $event->path();
41+
//your code, for example resizing and cropping
42+
}
43+
}
44+
```

doc/installation.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
55
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
66
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
7+
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
8+
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
79

810
## Requirements
911

doc/integration.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
55
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
66
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
7+
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
8+
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
79

810
## WYSIWYG Editor Integration:
911
### Option 1: CKEditor

doc/upgrade.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Documents
2+
3+
1. [Installation](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/installation.md)
4+
1. [Intergration](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/integration.md)
5+
1. [Config](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/config.md)
6+
1. [Customization](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/customization.md)
7+
1. [Events](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/events.md)
8+
1. [Upgrade](https://github.com/UniSharp/laravel-filemanager/blob/master/doc/upgrade.md)
9+
10+
## Upgrade guide
11+
* `composer update unisharp/laravel-filemanager`
12+
* `php artisan vendor:publish --tag=lfm_view --force`
13+
* `php artisan vendor:publish --tag=lfm_config --force` (IMPORTANT: please backup your own `config/lfm.php` first)
14+

0 commit comments

Comments
 (0)