Skip to content

Commit

Permalink
rename namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed May 26, 2024
1 parent 83e65a9 commit 6280910
Show file tree
Hide file tree
Showing 50 changed files with 188 additions and 188 deletions.
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Flexible Media Library for Laravel

[![Latest Version on Packagist](https://img.shields.io/packagist/v/ElegantEngineeringTech/laravel-media.svg?style=flat-square)](https://packagist.org/packages/ElegantEngineeringTech/laravel-media)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/elegantly/laravel-media.svg?style=flat-square)](https://packagist.org/packages/elegantly/laravel-media)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/ElegantEngineeringTech/laravel-media/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/ElegantEngineeringTech/laravel-media/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/ElegantEngineeringTech/laravel-media/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/ElegantEngineeringTech/laravel-media/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/ElegantEngineeringTech/laravel-media.svg?style=flat-square)](https://packagist.org/packages/ElegantEngineeringTech/laravel-media)
[![Total Downloads](https://img.shields.io/packagist/dt/elegantly/laravel-media.svg?style=flat-square)](https://packagist.org/packages/elegantly/laravel-media)

This package offers an extremely flexible media library, enabling you to store any type of file along with their conversions (nested conversions are supported). It is designed to work seamlessly with any filesystem solutions (local or cloud) such as Bunny.net, AWS S3/MediaConvert, Transloadit, among others.

Expand Down Expand Up @@ -49,18 +49,18 @@ Here is how our `Channel` class will be defined:
```php
namespace App\Models;

use ElegantEngineeringTech\Media\Traits\HasMedia;
use ElegantEngineeringTech\Media\MediaCollection;
use ElegantEngineeringTech\Media\MediaConversion;
use ElegantEngineeringTech\Media\Enums\MediaType;
use Elegantly\Media\Traits\HasMedia;
use Elegantly\Media\MediaCollection;
use Elegantly\Media\MediaConversion;
use Elegantly\Media\Enums\MediaType;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Spatie\Image\Enums\Fit;
use \App\Jobs\Media\OptimizedImageConversionJob;
use ElegantEngineeringTech\Media\Models\Media;
use ElegantEngineeringTech\Media\Contracts\InteractWithMedia;
use Elegantly\Media\Models\Media;
use Elegantly\Media\Contracts\InteractWithMedia;
use Illuminate\Contracts\Support\Arrayable;
use ElegantEngineeringTech\Media\Support\ResponsiveImagesConversionsPreset;
use Elegantly\Media\Support\ResponsiveImagesConversionsPreset;

class Channel extends Model implements InteractWithMedia
{
Expand Down Expand Up @@ -194,7 +194,7 @@ class ImageUploader extends Component
You can install the package via composer:

```bash
composer require ElegantEngineeringTech/laravel-media
composer require elegantly/laravel-media
```

You have to publish and run the migrations with:
Expand All @@ -213,13 +213,13 @@ php artisan vendor:publish --tag="laravel-media-config"
This is the contents of the published config file:

```php
use ElegantEngineeringTech\Media\Jobs\DeleteModelMediaJob;
use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Jobs\DeleteModelMediaJob;
use Elegantly\Media\Models\Media;

return [
/**
* The media model
* Define your own model here by extending \ElegantEngineeringTech\Media\Models\Media::class
* Define your own model here by extending \Elegantly\Media\Models\Media::class
*/
'model' => Media::class,

Expand Down Expand Up @@ -318,9 +318,9 @@ First, you need to add the `HasMedia` trait and the `InteractWithMedia` interfac
```php
namespace App\Models;

use ElegantEngineeringTech\Media\Traits\HasMedia;
use Elegantly\Media\Traits\HasMedia;
use Illuminate\Database\Eloquent\Model;
use ElegantEngineeringTech\Media\Contracts\InteractWithMedia;
use Elegantly\Media\Contracts\InteractWithMedia;

class Channel extends Model implements InteractWithMedia
{
Expand All @@ -334,10 +334,10 @@ You can then define your media collections in the `registerMediaCollections` met
```php
namespace App\Models;

use ElegantEngineeringTech\Media\Traits\HasMedia;
use ElegantEngineeringTech\Media\MediaCollection;
use Elegantly\Media\Traits\HasMedia;
use Elegantly\Media\MediaCollection;
use Illuminate\Database\Eloquent\Model;
use ElegantEngineeringTech\Media\Contracts\InteractWithMedia;
use Elegantly\Media\Contracts\InteractWithMedia;
use Illuminate\Contracts\Support\Arrayable;

class Channel extends Model implements InteractWithMedia
Expand Down Expand Up @@ -377,18 +377,18 @@ This package provides common jobs for your conversions to simplify your work:
```php
namespace App\Models;

use ElegantEngineeringTech\Media\Traits\HasMedia;
use ElegantEngineeringTech\Media\MediaCollection;
use ElegantEngineeringTech\Media\MediaConversion;
use ElegantEngineeringTech\Media\Enums\MediaType;
use Elegantly\Media\Traits\HasMedia;
use Elegantly\Media\MediaCollection;
use Elegantly\Media\MediaConversion;
use Elegantly\Media\Enums\MediaType;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Spatie\Image\Enums\Fit;
use \App\Jobs\Media\OptimizedImageConversionJob;
use ElegantEngineeringTech\Media\Models\Media;
use ElegantEngineeringTech\Media\Contracts\InteractWithMedia;
use Elegantly\Media\Models\Media;
use Elegantly\Media\Contracts\InteractWithMedia;
use Illuminate\Contracts\Support\Arrayable;
use ElegantEngineeringTech\Media\Support\ResponsiveImagesConversionsPreset;
use Elegantly\Media\Support\ResponsiveImagesConversionsPreset;

class Channel extends Model implements InteractWithMedia
{
Expand Down Expand Up @@ -446,7 +446,7 @@ You can create your own conversion by creating a new class in your app (e.g., `A

Media conversions are executed through Laravel Jobs. You can perform any task in the job, provided that:

- Your job extends `ElegantEngineeringTech\Media\Jobs\MediaConversion`.
- Your job extends `Elegantly\Media\Jobs\MediaConversion`.
- Your job defines a `run` method.
- Your job calls `$this->media->storeConversion(...)`.

Expand All @@ -457,12 +457,12 @@ Let's consider a common media conversion task: optimizing an image. Here's how y
```php
namespace App\Support\MediaConversions;

use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Models\Media;
use Illuminate\Support\Facades\File;
use Spatie\Image\Enums\Fit;
use Spatie\Image\Image;
use Spatie\ImageOptimizer\OptimizerChain;
use ElegantEngineeringTech\Media\Jobs\MediaConversionJob;
use Elegantly\Media\Jobs\MediaConversionJob;

class OptimizedImageConversionJob extends MediaConversionJob
{
Expand Down Expand Up @@ -512,7 +512,7 @@ First, create your own model class:
```php
namespace App\Models;

use ElegantEngineeringTech\Media\Models\Media as FinllerMedia;
use Elegantly\Media\Models\Media as FinllerMedia;

class Media extends FinllerMedia
{
Expand Down Expand Up @@ -540,8 +540,8 @@ The library is typed with generics, so you can use your own Media model seamless
namespace App\Models;

use App\Models\Media;
use ElegantEngineeringTech\Media\Traits\HasMedia;
use ElegantEngineeringTech\Media\Contracts\InteractWithMedia;
use Elegantly\Media\Traits\HasMedia;
use Elegantly\Media\Contracts\InteractWithMedia;

/**
* @implements InteractWithMedia<Media>
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "elegantengineeringtech/laravel-media",
"name": "elegantly/laravel-media",
"description": "A flexible media library for Laravel",
"keywords": [
"ElegantEngineeringTech",
"Elegantly",
"laravel",
"laravel-media"
],
Expand Down Expand Up @@ -38,13 +38,13 @@
},
"autoload": {
"psr-4": {
"ElegantEngineeringTech\\Media\\": "src/",
"ElegantEngineeringTech\\Media\\Database\\Factories\\": "database/factories/"
"Elegantly\\Media\\": "src/",
"Elegantly\\Media\\Database\\Factories\\": "database/factories/"
}
},
"autoload-dev": {
"psr-4": {
"ElegantEngineeringTech\\Media\\Tests\\": "tests/",
"Elegantly\\Media\\Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/"
}
},
Expand Down Expand Up @@ -76,7 +76,7 @@
"extra": {
"laravel": {
"providers": [
"ElegantEngineeringTech\\Media\\MediaServiceProvider"
"Elegantly\\Media\\MediaServiceProvider"
]
}
},
Expand Down
6 changes: 3 additions & 3 deletions config/media.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

use ElegantEngineeringTech\Media\Jobs\DeleteModelMediaJob;
use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Jobs\DeleteModelMediaJob;
use Elegantly\Media\Models\Media;

return [
/**
* The media model
* Define your own model here by extending \ElegantEngineeringTech\Media\Models\Media::class
* Define your own model here by extending \Elegantly\Media\Models\Media::class
*/
'model' => Media::class,

Expand Down
8 changes: 4 additions & 4 deletions database/factories/MediaFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace ElegantEngineeringTech\Media\Database\Factories;
namespace Elegantly\Media\Database\Factories;

use ElegantEngineeringTech\Media\Casts\GeneratedConversion;
use ElegantEngineeringTech\Media\Enums\MediaType;
use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Casts\GeneratedConversion;
use Elegantly\Media\Enums\MediaType;
use Elegantly\Media\Models\Media;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Casts/GeneratedConversion.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace ElegantEngineeringTech\Media\Casts;
namespace Elegantly\Media\Casts;

use Carbon\Carbon;
use ElegantEngineeringTech\Media\Enums\MediaType;
use ElegantEngineeringTech\Media\Traits\InteractsWithMediaFiles;
use Elegantly\Media\Enums\MediaType;
use Elegantly\Media\Traits\InteractsWithMediaFiles;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
Expand Down
2 changes: 1 addition & 1 deletion src/Casts/GeneratedConversions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace ElegantEngineeringTech\Media\Casts;
namespace Elegantly\Media\Casts;

use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Database\Eloquent\Model;
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/GenerateMediaConversionsCommand.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace ElegantEngineeringTech\Media\Commands;
namespace Elegantly\Media\Commands;

use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Models\Media;
use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
Expand Down
8 changes: 4 additions & 4 deletions src/Contracts/InteractWithMedia.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace ElegantEngineeringTech\Media\Contracts;
namespace Elegantly\Media\Contracts;

use ElegantEngineeringTech\Media\MediaCollection;
use ElegantEngineeringTech\Media\MediaConversion;
use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\MediaCollection;
use Elegantly\Media\MediaConversion;
use Elegantly\Media\Models\Media;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Http\File;
Expand Down
4 changes: 2 additions & 2 deletions src/Enums/MediaType.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace ElegantEngineeringTech\Media\Enums;
namespace Elegantly\Media\Enums;

use ElegantEngineeringTech\Media\Helpers\File;
use Elegantly\Media\Helpers\File;
use ProtoneMedia\LaravelFFMpeg\FFMpeg\FFProbe;

enum MediaType: string
Expand Down
4 changes: 2 additions & 2 deletions src/Events/MediaFileStoredEvent.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace ElegantEngineeringTech\Media\Events;
namespace Elegantly\Media\Events;

use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Models\Media;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

Expand Down
2 changes: 1 addition & 1 deletion src/FileDownloaders/FileDownloader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace ElegantEngineeringTech\Media\FileDownloaders;
namespace Elegantly\Media\FileDownloaders;

use Exception;
use Spatie\TemporaryDirectory\TemporaryDirectory;
Expand Down
4 changes: 2 additions & 2 deletions src/Helpers/File.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace ElegantEngineeringTech\Media\Helpers;
namespace Elegantly\Media\Helpers;

use ElegantEngineeringTech\Media\Enums\MediaType;
use Elegantly\Media\Enums\MediaType;
use FFMpeg\Coordinate\Dimension;
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Http\File as HttpFile;
Expand Down
2 changes: 1 addition & 1 deletion src/Helpers/HasDimension.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace ElegantEngineeringTech\Media\Helpers;
namespace Elegantly\Media\Helpers;

use FFMpeg\Coordinate\AspectRatio;
use FFMpeg\Coordinate\Dimension;
Expand Down
2 changes: 1 addition & 1 deletion src/Helpers/Image.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace ElegantEngineeringTech\Media\Helpers;
namespace Elegantly\Media\Helpers;

use FFMpeg\Coordinate\AspectRatio;
use FFMpeg\Coordinate\Dimension;
Expand Down
2 changes: 1 addition & 1 deletion src/Helpers/Video.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace ElegantEngineeringTech\Media\Helpers;
namespace Elegantly\Media\Helpers;

use FFMpeg\Coordinate\AspectRatio;
use FFMpeg\Coordinate\Dimension;
Expand Down
4 changes: 2 additions & 2 deletions src/Jobs/DeleteModelMediaJob.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace ElegantEngineeringTech\Media\Jobs;
namespace Elegantly\Media\Jobs;

use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Models\Media;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
Expand Down
8 changes: 4 additions & 4 deletions src/Jobs/MediaConversionJob.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace ElegantEngineeringTech\Media\Jobs;
namespace Elegantly\Media\Jobs;

use ElegantEngineeringTech\Media\Casts\GeneratedConversion;
use ElegantEngineeringTech\Media\MediaConversion;
use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Casts\GeneratedConversion;
use Elegantly\Media\MediaConversion;
use Elegantly\Media\Models\Media;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
Expand Down
4 changes: 2 additions & 2 deletions src/Jobs/OptimizedImageConversionJob.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace ElegantEngineeringTech\Media\Jobs;
namespace Elegantly\Media\Jobs;

use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Models\Media;
use Illuminate\Support\Facades\File;
use Spatie\Image\Enums\Fit;
use Spatie\Image\Image;
Expand Down
4 changes: 2 additions & 2 deletions src/Jobs/OptimizedVideoConversionJob.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace ElegantEngineeringTech\Media\Jobs;
namespace Elegantly\Media\Jobs;

use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Models\Media;
use FFMpeg\Filters\Video\ResizeFilter;
use FFMpeg\Format\FormatInterface;
use FFMpeg\Format\Video\X264;
Expand Down
4 changes: 2 additions & 2 deletions src/Jobs/VideoPosterConversionJob.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace ElegantEngineeringTech\Media\Jobs;
namespace Elegantly\Media\Jobs;

use ElegantEngineeringTech\Media\Models\Media;
use Elegantly\Media\Models\Media;
use FFMpeg\Coordinate\TimeCode;
use Illuminate\Support\Facades\File;
use ProtoneMedia\LaravelFFMpeg\Support\FFMpeg;
Expand Down
Loading

0 comments on commit 6280910

Please sign in to comment.