PHP code example of ghostcompiler / laravel-uploads

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

    

ghostcompiler / laravel-uploads example snippets


use GhostCompiler\LaravelUploads\Facades\Uploads;

// Store a file under configured defaults
$upload = Uploads::upload($request->file('avatar'));

// Store to a specific directory inside the storage path
$upload = Uploads::upload('avatars', $request->file('avatar'));

$upload = Uploads::upload('https://avatar.example.com/user123.jpg');

// Generates a secure routing URL expiring in 15 minutes
$url = Uploads::url($upload, 15);
bash
composer install:laravel-uploads
php artisan migrate
bash
php artisan install:laravel-uploads --force