PHP code example of curly-deni / laravel-storage

1. Go to this page and download the library: Download curly-deni/laravel-storage 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/ */

    

curly-deni / laravel-storage example snippets


use Aesis\Storage\Models\File;

$file = File::storeContents($user, 'avatars', $contents, 'png', 'image/png');
$url = $file->resolvedUrl();

$file->delete(); // Deletes the stored object and its database record.

's3-private' => [
    'driver' => 'aesis_s3',
    // Laravel S3 credentials, bucket, endpoint, and path-style options...
    'url_access' => 'temporary',
    'temporary_url_ttl' => 30,
],

's3-public' => [
    'driver' => 'aesis_s3',
    // Laravel S3 credentials, bucket, endpoint, and path-style options...
    'url_access' => 'public',
],
bash
composer vendor:publish --tag="storage-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="storage-config"