Skip to content

Commit 300a4a3

Browse files
committed
Finish package development with the first release
1 parent 71f9497 commit 300a4a3

File tree

6 files changed

+29
-22
lines changed

6 files changed

+29
-22
lines changed

README.md

+14-11
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
[![Latest Unstable Version](https://poser.pugx.org/itstructure/laravel-media-file-uploader/v/unstable)](https://packagist.org/packages/itstructure/laravel-media-file-uploader)
55
[![License](https://poser.pugx.org/itstructure/laravel-media-file-uploader/license)](https://packagist.org/packages/itstructure/laravel-media-file-uploader)
66
[![Total Downloads](https://poser.pugx.org/itstructure/laravel-media-file-uploader/downloads)](https://packagist.org/packages/itstructure/laravel-media-file-uploader)
7-
[![Build Status](https://scrutinizer-ci.com/g/itstructure/laravel-media-file-uploader/badges/build.png?b=main)](https://scrutinizer-ci.com/g/itstructure/laravel-media-file-uploader/build-status/dev)
8-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/itstructure/laravel-media-file-uploader/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/itstructure/laravel-media-file-uploader/?branch=dev)
7+
[![Build Status](https://scrutinizer-ci.com/g/itstructure/laravel-media-file-uploader/badges/build.png?b=main)](https://scrutinizer-ci.com/g/itstructure/laravel-media-file-uploader/build-status/main)
8+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/itstructure/laravel-media-file-uploader/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/itstructure/laravel-media-file-uploader/?branch=main)
99

1010
## 1 Introduction
1111

1212
This package is to upload different media files to Local or remote Amazon S3 storage.
1313

14-
![MFU logotip](https://github.com/itstructure/laravel-media-file-uploader/blob/dev/mfu_logotip.png)
14+
![MFU logotip](https://github.com/itstructure/laravel-media-file-uploader/blob/main/mfu_logotip.png)
1515

1616
## 2 Requirements
17-
- laravel 5.5+ | 6+ | 7+ | 8+ | 9+ | 10+ | 11+
17+
- laravel 6+ | 7+ | 8+ | 9+ | 10+ | 11+
1818
- Bootstrap 4 for styling
1919
- JQuery
20-
- php >= 7.1
20+
- php >= 7.2.5
2121
- composer
2222
- One of the next php extensions: GD|Imagick|Gmagick
2323

@@ -393,13 +393,13 @@ The next routes are available by default:
393393
</section>
394394
```
395395

396-
![MFU file list manager](https://github.com/itstructure/laravel-media-file-uploader/blob/dev/mfu_file_list_manager.png)
396+
![MFU file list manager](https://github.com/itstructure/laravel-media-file-uploader/blob/main/mfu_file_list_manager.png)
397397

398398
#### 5.2.2 Access to File upload manager
399399

400400
If to click on green **Uploader** button in a file list manager, you will go to **uploader_file_upload_manager** route.
401401

402-
![MFU file upload manager](https://github.com/itstructure/laravel-media-file-uploader/blob/dev/mfu_file_upload_manager.png)
402+
![MFU file upload manager](https://github.com/itstructure/laravel-media-file-uploader/blob/main/mfu_file_upload_manager.png)
403403

404404
#### 5.2.3 Access to File edit manager
405405

@@ -411,7 +411,7 @@ Also you can use this route as in a simple example below:
411411
route('uploader_file_edit_manager', ['id' => 1])
412412
```
413413

414-
![MFU file edit manager](https://github.com/itstructure/laravel-media-file-uploader/blob/dev/mfu_file_edit_manager.png)
414+
![MFU file edit manager](https://github.com/itstructure/laravel-media-file-uploader/blob/main/mfu_file_edit_manager.png)
415415

416416
#### 5.2.4 Access to Media file preview
417417

@@ -455,17 +455,17 @@ Value `adminlte::page` is for case if you use [AdminLTE](https://github.com/jero
455455

456456
Image album list example looks like this:
457457

458-
![MFU album list](https://github.com/itstructure/laravel-media-file-uploader/blob/dev/mfu_album_list.png)
458+
![MFU album list](https://github.com/itstructure/laravel-media-file-uploader/blob/main/mfu_album_list.png)
459459

460460
Image album edition page example looks like this:
461461

462-
![MFU album edit](https://github.com/itstructure/laravel-media-file-uploader/blob/dev/mfu_album_edit.png)
462+
![MFU album edit](https://github.com/itstructure/laravel-media-file-uploader/blob/main/mfu_album_edit.png)
463463

464464
### 5.3 Digging deeper
465465

466466
#### 5.3.1 Data base structure
467467

468-
![MFU db](https://github.com/itstructure/laravel-media-file-uploader/blob/dev/mfu_db.png)
468+
![MFU db](https://github.com/itstructure/laravel-media-file-uploader/blob/main/mfu_db.png)
469469

470470
#### 5.3.2 Short architecture structure and request way for uploading process in simple words
471471

@@ -654,6 +654,9 @@ By `fileType` there will be set a field `image[]`, which will be set by `fill()`
654654
and then it's value will be put in to the `BehaviorMediafile` object during `booted()` calling after for example `Product` is saved. Then a table `owners_mediafiles` will be filled.
655655
Link between `Product` and `Mediafile` will be created.
656656

657+
Product edition page example looks like this:
658+
659+
![MFU product edit](https://github.com/itstructure/laravel-media-file-uploader/blob/main/mfu_product_edit.png)
657660

658661
To see more, how that example works in global, see real example here: [Laravel Microshop Simple](https://github.com/itstructure/laravel-microshop-simple).
659662

changelog.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
### CHANGE LOG:
22

3-
**1.0.0 January 02, 2024:**
4-
- Create extension with the first release.
3+
**1.0.0 July 14, 2024:**
4+
- Finish package development with the first release.

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
}
1414
],
1515
"require": {
16-
"php": ">=7.1.0",
16+
"php": ">=7.2.5",
1717
"laravel/framework": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
18-
"itstructure/laravel-grid-view": "~1.1.1"
18+
"itstructure/laravel-grid-view": "~1.1.3"
1919
},
2020
"autoload": {
2121
"psr-4": {

mfu_product_edit.png

633 KB
Loading

src/Classes/ThumbConfig.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ThumbConfig
2828
private $height;
2929

3030
/**
31-
* @var
31+
* @var string|null
3232
*/
3333
private $mode;
3434

@@ -82,9 +82,9 @@ public function getHeight()
8282
}
8383

8484
/**
85-
* @return string
85+
* @return string|null
8686
*/
87-
public function getMode(): string
87+
public function getMode(): ?string
8888
{
8989
return $this->mode;
9090
}

src/Processors/SaveProcessor.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ abstract class SaveProcessor extends BaseProcessor
8686
/**
8787
* @var array
8888
*/
89-
protected $baseUploadDirectories;
89+
protected $baseUploadDirectories = [];
9090

9191
/**
9292
* @var array
@@ -527,13 +527,17 @@ protected function sendFile(): bool
527527
}
528528

529529
/**
530-
* @param string $mimeType
530+
* @param string|null $mimeType
531531
* @throws Exception
532532
* @return string
533533
*/
534-
protected function getBaseUploadDirectory(string $mimeType): string
534+
protected function getBaseUploadDirectory(?string $mimeType): string
535535
{
536-
if (!is_array($this->baseUploadDirectories) || empty($this->baseUploadDirectories)) {
536+
if (empty($mimeType)) {
537+
throw new Exception('The mimeType attribute is empty.');
538+
}
539+
540+
if (empty($this->baseUploadDirectories)) {
537541
throw new Exception('The baseUploadDirectories attribute is not defined correctly.');
538542
}
539543

0 commit comments

Comments
 (0)