1. Go to this page and download the library: Download bizly/nova-field-cloudinary library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Silvanite\NovaFieldCloudinary\Fields\CloudinaryImage;
public function fields(Request $request)
{
return [
...
CloudinaryImage::make('Profile Photo'),
]
}
// Using the helper (with transformation)
return cloudinary_image($this->profile_photo, [
"width" => 200,
"height" => 200,
"crop" => "fill",
"gravity" => "auto",
])
// Using the Storage Facade (without transformation)
return Storage::disk('cloudinary')->url($this->profile_photo);
// Using the Storage Facade (with transformation)
return Storage::disk('cloudinary')->url([
'public_id' => $this->profile_photo,
'options' => [
"width" => 200,
"height" => 200,
"crop" => "fill",
"gravity" => "auto",
],
])
use Silvanite\NovaFieldCloudinary\Fields\CloudinaryAudio;
public function fields(Request $request)
{
return [
...
CloudinaryAudio::make('Audio Source'),
]
}
// Using the audio helper
return cloudinary_audio($this->audio_source);
// Using the Storage Facade
return Storage::disk('cloudinary')->url([
'public_id' => $this->audio_source,
'options' => [
"resource_type" => "video",
],
])
use Silvanite\NovaFieldCloudinary\Fields\CloudinaryVideo;
public function fields(Request $request)
{
return [
...
CloudinaryVideo::make('Video Source'),
]
}
// Using the video helper
return cloudinary_video($this->video_source);
// Using the Storage Facade
return Storage::disk('cloudinary')->url([
'public_id' => $this->audio_source,
'options' => [
"resource_type" => "video",
],
])
use Silvanite\NovaFieldCloudinary\Fields\CloudinaryFile;
public function fields(Request $request)
{
return [
...
CloudinaryFile::make('Document'),
]
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.