Skip to content

Commit

Permalink
laravel 9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
alexusmai committed Feb 20, 2022
1 parent 1ad2543 commit 2d334a9
Show file tree
Hide file tree
Showing 28 changed files with 501 additions and 421 deletions.
47 changes: 10 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Laravel File Manager

[![Latest Stable Version](https://poser.pugx.org/alexusmai/laravel-file-manager/v/stable)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![Total Downloads](https://poser.pugx.org/alexusmai/laravel-file-manager/downloads)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![Latest Unstable Version](https://poser.pugx.org/alexusmai/laravel-file-manager/v/unstable)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![License](https://poser.pugx.org/alexusmai/laravel-file-manager/license)](https://packagist.org/packages/alexusmai/laravel-file-manager)

[![Latest Stable Version](http://poser.pugx.org/alexusmai/laravel-file-manager/v)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![Total Downloads](http://poser.pugx.org/alexusmai/laravel-file-manager/downloads)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![Latest Unstable Version](http://poser.pugx.org/alexusmai/laravel-file-manager/v/unstable)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![License](http://poser.pugx.org/alexusmai/laravel-file-manager/license)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![PHP Version Require](http://poser.pugx.org/alexusmai/laravel-file-manager/require/php)](https://packagist.org/packages/alexusmai/laravel-file-manager)

![Laravel File Manager](https://raw.github.com/alexusmai/vue-laravel-file-manager/master/src/assets/laravel-file-manager.gif?raw=true)

Expand Down Expand Up @@ -66,36 +66,9 @@
* Dynamic configuration (v2.4)
* Supported locales : ru, en, ar, sr, cs, de, es, nl, zh-CN, fa, it, tr, fr, pt-BR, zh-TW, pl

## In a new version 2.5

You can change Route prefix (default - 'file-manager')

```php
/**
* LFM Route prefix
* !!! WARNING - if you change it, you should compile frontend with new prefix(baseUrl) !!!
*/
'routePrefix' => 'file-manager',
```

Open PDF files in a new tab (test) - use 'double-click'

## Upgrading to version 2.5

Add a new parameter to the configuration file (config/file-manager.php)

```php
/**
* LFM Route prefix
* !!! WARNING - if you change it, you should compile frontend with new prefix(baseUrl) !!!
*/
'routePrefix' => 'file-manager',

```

Update pre-compiled css and js files.

## In a new version 3

```php
php artisan vendor:publish --tag=fm-assets --force
```
- **Version 3 only works with Laravel 9!**
- Vue.js 3
- Bootstrap 5
- Bootstrap Icons
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"license": "MIT",
"minimum-stability": "dev",
"require": {
"php": ">=7.1.0",
"php": "^8.0",
"ext-zip": "*",
"ext-json": "*",
"laravel/framework": "^5.5|^6.0|^7.0|^8.0",
"league/flysystem": "^1.0",
"intervention/image": "^2.4",
"intervention/imagecache": "^2.3"
"laravel/framework": "^9.0",
"league/flysystem": "^3.0",
"intervention/image": "^2.7",
"intervention/imagecache": "^2.5"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 4 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Laravel File Manager

[![Latest Stable Version](https://poser.pugx.org/alexusmai/laravel-file-manager/v/stable)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![Total Downloads](https://poser.pugx.org/alexusmai/laravel-file-manager/downloads)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![Latest Unstable Version](https://poser.pugx.org/alexusmai/laravel-file-manager/v/unstable)](https://packagist.org/packages/alexusmai/laravel-file-manager)
[![License](https://poser.pugx.org/alexusmai/laravel-file-manager/license)](https://packagist.org/packages/alexusmai/laravel-file-manager)

## Docs

* [Installation](./installation.md)
Expand All @@ -15,8 +10,9 @@
* [Update](./update.md)

## Requirements
* PHP >= 7.1.0
* Laravel 5.5 or higher
* PHP >= 8.0
* ext-zip - for zip and unzip functions
* Laravel 9 or higher
* GD Library or Imagick for [intervention/image](https://github.com/Intervention/image)
* requires [intervention/image](https://github.com/Intervention/image) and [intervention/imagecache](https://github.com/Intervention/imagecache)
* Bootstrap 4 and Font Awesome 5
* Bootstrap 5 and Bootstrap Icons v1.8.0 and higher
131 changes: 76 additions & 55 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,90 @@
# Installation

1. Install package - using composer

```bash
composer require alexusmai/laravel-file-manager
```
```
composer require alexusmai/laravel-file-manager
```

For Laravel 5 - 8 use v2.5.4

```
composer require alexusmai/laravel-file-manager "2.5.4"
```

2. If you use Laravel 5.4, then add service provider to config/app.php (for the Laravel 5.5 and higher skip this step):

```php
Alexusmai\LaravelFileManager\FileManagerServiceProvider::class,
```
```php
Alexusmai\LaravelFileManager\FileManagerServiceProvider::class,
```

3. Publish configuration file

```bash
php artisan vendor:publish --tag=fm-config
```
```bash
php artisan vendor:publish --tag=fm-config
```

4. You can install npm package directly and use it in your vue application - more information about it -
[vue-laravel-file-manager](https://github.com/alexusmai/vue-laravel-file-manager)

>OR

Publish compiled and minimized js and css files

```
php artisan vendor:publish --tag=fm-assets
```

Open the view file where you want to place the application block, and add:

* add a csrf token to head block if you did not do it before

```html
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
```

* the frontend package uses **Bootstrap 4** and **Font Awesome 5** styles, if you already use it, then you do not need to connect any styles.
Otherwise add -

```html
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
```

* add file manager styles

```html
<link rel="stylesheet" href="{{ asset('vendor/file-manager/css/file-manager.css') }}">
```

* add file manager js

```html
<script src="{{ asset('vendor/file-manager/js/file-manager.js') }}"></script>
```

* add div for application (set application height!)

```html
<div style="height: 600px;">
<div id="fm"></div>
</div>
```


> OR
Publish compiled and minimized js and css files

```
php artisan vendor:publish --tag=fm-assets
```

Open the view file where you want to place the application block, and add:

* add a csrf token to head block if you did not do it before

```
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
```

* For version 3 and higher - the frontend package uses **Bootstrap 5** and **Bootstrap Icons** styles, if you already use it,
then you do not need to connect any styles. Otherwise, add -

```
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
```

* For old versions - the frontend package uses **Bootstrap 4** and **Font Awesome 5** styles, if you already use it,
then you do not need to connect any styles. Otherwise, add -

```
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
```

* add file manager styles

```
<link rel="stylesheet" href="{{ asset('vendor/file-manager/css/file-manager.css') }}">
```

* add file manager js

```
<script src="{{ asset('vendor/file-manager/js/file-manager.js') }}"></script>
```

* For version 3 and higher - add div for application (set application height!)

```
<div id="fm" style="height: 600px;"></div>
```

* For old versions - add div for application (set application height!)

```
<div style="height: 600px;">
<div id="fm"></div>
</div>
```

## What's next

Expand Down
2 changes: 1 addition & 1 deletion examples/wysiwyg/ckeditor.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">

<title>File manager and CKeditor</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions examples/wysiwyg/fm-button.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">

<title>File Manager and standalone button</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions examples/wysiwyg/summernote.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<!-- SummerNote -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote-bs4.css" rel="stylesheet">

Expand Down
4 changes: 2 additions & 2 deletions examples/wysiwyg/tinymce.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">

<title>File manager and TinyMCE</title>
</head>
Expand Down
20 changes: 9 additions & 11 deletions resources/assets/css/file-manager.css

Large diffs are not rendered by default.

134 changes: 106 additions & 28 deletions resources/assets/js/file-manager.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion resources/assets/js/file-manager.js.map

This file was deleted.

9 changes: 4 additions & 5 deletions resources/views/ckeditor.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>{{ config('app.name', 'File Manager') }}</title>

<!-- Styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css">
<link href="{{ asset('vendor/file-manager/css/file-manager.css') }}" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link rel="stylesheet" href="{{ asset('vendor/file-manager/css/file-manager.css') }}">
</head>
<body>
<div class="container-fluid">
Expand Down
9 changes: 4 additions & 5 deletions resources/views/fmButton.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>{{ config('app.name', 'File Manager') }}</title>

<!-- Styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css">
<link href="{{ asset('vendor/file-manager/css/file-manager.css') }}" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link rel="stylesheet" href="{{ asset('vendor/file-manager/css/file-manager.css') }}">
</head>
<body>
<div class="container-fluid">
Expand Down
9 changes: 4 additions & 5 deletions resources/views/summernote.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>{{ config('app.name', 'File Manager') }}</title>

<!-- Styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css">
<link href="{{ asset('vendor/file-manager/css/file-manager.css') }}" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link rel="stylesheet" href="{{ asset('vendor/file-manager/css/file-manager.css') }}">
</head>
<body>
<div class="container-fluid">
Expand Down
9 changes: 4 additions & 5 deletions resources/views/tinymce.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>{{ config('app.name', 'File Manager') }}</title>

<!-- Styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css">
<link href="{{ asset('vendor/file-manager/css/file-manager.css') }}" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link rel="stylesheet" href="{{ asset('vendor/file-manager/css/file-manager.css') }}">
</head>
<body>
<div class="container-fluid">
Expand Down
Loading

0 comments on commit 2d334a9

Please sign in to comment.