Skip to content

Commit 76fa667

Browse files
committed
start with a clean slate
1 parent 092c283 commit 76fa667

27 files changed

+26
-2993
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The MIT License (MIT)
22

3-
Copyright (c) 2020 Cloudinary Labs
3+
Copyright (c) 2025 Cloudinary Labs
44

55
> Permission is hereby granted, free of charge, to any person obtaining a copy
66
> of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,13 @@
2222

2323
- [Installation](#installation)
2424
- [Configuration](#configuration)
25-
- [Upload, Retrieval & Transformation](#upload-retrieval--transformation)
26-
- [Attach Files to Eloquent Models](#attach-files-to-eloquent-models)
27-
- [Media Management via CLI](#media-management-via-cli)
28-
- [Cloudinary URL Generation](#cloudinary-url-generation)
29-
- [Blade Components](#blade-components)
3025
- [Disclaimer](#disclaimer)
3126
- [Contributions](#contributions)
3227
- [License](#license)
3328

3429
## Installation
3530

36-
Requires PHP 8.1+ and Laravel 10+.
31+
Requires PHP 8.2+ and Laravel 11+.
3732

3833
```bash
3934
composer require cloudinary-labs/cloudinary-laravel
@@ -58,179 +53,6 @@ CLOUDINARY_NOTIFICATION_URL=
5853
> [!NOTE]
5954
> You can get your `CLOUDINARY_URL` from your [Cloudinary console](https://cloudinary.com/console). It typically looks like this: `cloudinary://API_KEY:API_SECRET@CLOUD_NAME`. Make sure to replace `API_KEY`, `API_SECRET`, and `CLOUD_NAME` with your actual Cloudinary credentials.
6055
61-
## Usage
62-
63-
### Upload, Retrieval & Transformation
64-
65-
```php
66-
// Upload
67-
$uploadedFileUrl = cloudinary()->upload($request->file('file')->getRealPath())->getSecurePath();
68-
69-
// Upload with transformation
70-
$uploadedFileUrl = cloudinary()->upload($request->file('file')->getRealPath(), [
71-
'folder' => 'uploads',
72-
'transformation' => [
73-
'width' => 400,
74-
'height' => 400,
75-
'crop' => 'fill'
76-
]
77-
])->getSecurePath();
78-
79-
// Get URL
80-
$url = cloudinary()->getUrl($publicId);
81-
82-
// Check if file exists
83-
$exists = Storage::disk('cloudinary')->fileExists($publicId);
84-
```
85-
86-
### Attach Files to Eloquent Models
87-
88-
First, add the `MediaAlly` trait to your model:
89-
90-
```php
91-
use CloudinaryLabs\CloudinaryLaravel\MediaAlly;
92-
93-
class Page extends Model
94-
{
95-
use MediaAlly;
96-
// ...
97-
}
98-
```
99-
100-
Then, you can use the following methods:
101-
102-
```php
103-
// Attach media
104-
$page->attachMedia($request->file('file'));
105-
106-
// Retrieve media
107-
$allMedia = $page->fetchAllMedia();
108-
$firstMedia = $page->fetchFirstMedia();
109-
$lastMedia = $page->fetchLastMedia();
110-
111-
// Update media
112-
$page->updateMedia($newFile);
113-
114-
// Detach media
115-
$page->detachMedia($file);
116-
```
117-
118-
### Media Management via CLI
119-
120-
```bash
121-
php artisan cloudinary:backup
122-
php artisan cloudinary:delete
123-
php artisan cloudinary:fetch
124-
php artisan cloudinary:rename
125-
php artisan cloudinary:upload
126-
```
127-
128-
## Cloudinary URL Generation
129-
130-
Use the `Cloudinary` facade or the `cloudinary()` helper function to generate URLs:
131-
132-
```php
133-
use CloudinaryLabs\CloudinaryLaravel\Facades\Cloudinary;
134-
135-
$url = Cloudinary::getUrl($publicId);
136-
// or
137-
$url = cloudinary()->getUrl($publicId);
138-
```
139-
140-
## Blade Components
141-
142-
This package provides several Blade components for easy integration of Cloudinary media in your Laravel views
143-
144-
### Upload files via an Upload Widget
145-
146-
You can use the `<x-cld-upload-button />` Blade component that ships with this page like so:
147-
148-
```blade
149-
<!DOCTYPE html>
150-
<html>
151-
<head>
152-
... @cloudinaryJS
153-
</head>
154-
<body>
155-
<x-cld-upload-button>Upload Files</x-cld-upload-button>
156-
</body>
157-
</html>
158-
```
159-
160-
### Image Component
161-
162-
Basic usage:
163-
164-
```blade
165-
<x-cld-image public-id="example" />
166-
```
167-
168-
With additional properties:
169-
170-
```blade
171-
<x-cld-image public-id="example" width="300" height="300" />
172-
```
173-
174-
#### Properties available:
175-
176-
| Property | Required |
177-
| --------------------- | -------- |
178-
| `public-id` | Yes |
179-
| `width` | No |
180-
| `height` | No |
181-
| `alt` | No |
182-
| `class` | No |
183-
| `crop` | No |
184-
| `gravity` | No |
185-
| `effect` | No |
186-
| `rotate` | No |
187-
| `colorize` | No |
188-
| `trim` | No |
189-
| `blur` | No |
190-
| `gray-scale` | No |
191-
| `black-white` | No |
192-
| `sepia` | No |
193-
| `redeye` | No |
194-
| `negate` | No |
195-
| `oil-paint` | No |
196-
| `vignette` | No |
197-
| `simulate-colorblind` | No |
198-
| `pixelate` | No |
199-
| `unsharp-mask` | No |
200-
| `saturation` | No |
201-
| `contrast` | No |
202-
| `brightness` | No |
203-
| `gamma` | No |
204-
| `improve-mode` | No |
205-
| `shadow` | No |
206-
| `border` | No |
207-
| `round-corners` | No |
208-
| `bg-color` | No |
209-
| `art` | No |
210-
| `cartoonify` | No |
211-
212-
### Video Component
213-
214-
Basic usage:
215-
216-
```blade
217-
<x-cld-video public-id="example"></x-cld-video>
218-
```
219-
220-
With additional properties:
221-
222-
```blade
223-
<x-cld-video public-id="example" width="300" height="300" />
224-
```
225-
226-
#### Properties available:
227-
228-
| Property | Required |
229-
| ----------- | -------- |
230-
| `public-id` | Yes |
231-
| `width` | No |
232-
| `height` | No |
233-
23456
## Disclaimer
23557

23658
> _This software/code provided under Cloudinary Labs is an unsupported pre-production prototype undergoing further development and provided on an “AS IS” basis without warranty of any kind, express or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. Furthermore, Cloudinary is not under any obligation to provide a commercial version of the software.</br> </br> Your use of the Software/code is at your sole risk and Cloudinary will not be liable for any direct, indirect, incidental, special, exemplary, consequential or similar damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of the Software, even if advised of the possibility of such damage.</br> </br> You should refrain from uploading any confidential or personally identifiable information to the Software. All rights to and in the Software are and will remain at all times, owned by, or licensed to Cloudinary._

composer.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
"license": "MIT",
55
"authors": [
66
{
7-
"name": "Prosper Otemuyiwa",
8-
"email": "[email protected]",
9-
"homepage": "https://github.com/unicodeveloper"
7+
"name": "Josh Manders",
8+
"homepage": "https://github.com/joshmanders"
109
}
1110
],
1211
"homepage": "https://github.com/cloudinary-labs/cloudinary-laravel",
@@ -39,7 +38,7 @@
3938
"CloudinaryLabs\\CloudinaryLaravel\\": "src/"
4039
},
4140
"files": [
42-
"src/Support/helpers.php"
41+
"src/helpers.php"
4342
]
4443
},
4544
"autoload-dev": {
@@ -51,10 +50,7 @@
5150
"laravel": {
5251
"providers": [
5352
"CloudinaryLabs\\CloudinaryLaravel\\CloudinaryServiceProvider"
54-
],
55-
"aliases": {
56-
"Cloudinary": "CloudinaryLabs\\CloudinaryLaravel\\Facades\\Cloudinary"
57-
}
53+
]
5854
}
5955
},
6056
"config": {

config/cloudinary.php

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
| Cloudinary Configuration
1515
|--------------------------------------------------------------------------
1616
|
17-
| An HTTP or HTTPS URL to notify your application (a webhook) when the process of uploads, deletes, and any API
18-
| that accepts notification_url has completed.
17+
| An HTTP or HTTPS URL to notify your application (a webhook) when the
18+
| process of uploads, deletes, and any API that accepts notification_url
19+
| has completed.
1920
|
2021
|
2122
*/
@@ -26,25 +27,14 @@
2627
| Cloudinary Configuration
2728
|--------------------------------------------------------------------------
2829
|
29-
| Here you may configure your Cloudinary settings. Cloudinary is a cloud hosted
30-
| media management service for all file uploads, storage, delivery and transformation needs.
30+
| Here you may configure your Cloudinary settings. Cloudinary is a cloud
31+
| hosted media management service for all file uploads, storage, delivery
32+
| and transformation needs.
3133
|
3234
|
3335
*/
3436
'cloud_url' => env('CLOUDINARY_URL'),
35-
36-
/**
37-
* Upload Preset From Cloudinary Dashboard
38-
*/
3937
'upload_preset' => env('CLOUDINARY_UPLOAD_PRESET'),
40-
41-
/**
42-
* Route to get cloud_image_url from Blade Upload Widget
43-
*/
4438
'upload_route' => env('CLOUDINARY_UPLOAD_ROUTE'),
45-
46-
/**
47-
* Controller action to get cloud_image_url from Blade Upload Widget
48-
*/
4939
'upload_action' => env('CLOUDINARY_UPLOAD_ACTION'),
5040
];

database/migrations/2020_06_14_000001_create_media_table.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

resources/views/components/button.blade.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)