PHP code example of nodes / assets
1. Go to this page and download the library: Download nodes/assets 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/ */
nodes / assets example snippets
Nodes\Assets\ServiceProvider::class
'Assets' => Nodes\Assets\Support\Facades\Assets::class
'upload' => [
'provider' => function () {
$s3Config = config('filesystems.disks.s3');
$awsS3Config = config('nodes.assets.provider.aws-s3');
return new \Nodes\Assets\Upload\Providers\AmazonS3($awsS3Config, $s3Config);
},
],
'url' => [
'provider' => function () {
$imgIxConfig = config('nodes.assets.providers.imgix');
return new \Nodes\Assets\Url\Providers\ImgIX($imgIxConfig);
},
],
return [
'upload' => [
'provider' => function () {
$s3Config = config('filesystems.disks.s3');
$vaporCloudConfig = config('nodes.assets.providers.vapor-cloud');
return new \Nodes\Assets\Upload\Providers\VaporCloud($s3Config, $vaporCloudConfig);
},
],
'url' => [
'provider' => function () {
$vaporCloudConfig = config('nodes.assets.providers.vapor-cloud');
return new \Nodes\Assets\Url\Providers\VaporCloud($vaporCloudConfig);
},
],
];
Intervention\Image\ImageServiceProvider::class
'Image' => Intervention\Image\Facades\Image::class
return [
'upload' => [
'provider' => function () {
return new \Nodes\Assets\Upload\Providers\PublicFolder();
},
],
'url' => [
'provider' => function () {
return new \Nodes\Assets\Url\Providers\PublicFolder();
},
],
];
function assets_add($file, $folder = null, UploadSettings $settings = null)
function assets_add_uploaded_file(UploadedFile $file, $folder = null, UploadSettings $settings = null)
function assets_add_url($url, $folder = null, UploadSettings $settings = null)
function assets_add_data_uri($dataUri, $folder = null, UploadSettings $settings = null)
function assets_get($path, UrlSettings $settings = null)
Assets::add($file, $folder = null, UploadSettings $settings = null)
Assets::addFromUploadedFile(UploadedFile $file, $folder = null, UploadSettings $settings = null)
Assets::addFromUrl($url, $folder = null, UploadSettings $settings = null)
Assets::addFromDataUri($dataUri, $folder = null, UploadSettings $settings = null)
Assets::get($path)
bash
php artisan vendor:publish --provider="Nodes\Assets\ServiceProvider"
bash
php artisan vendor:publish --provider="Nodes\Assets\ServiceProvider" --force
bash
php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"