PHP code example of hamidrezaniazi / upolo

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

    

hamidrezaniazi / upolo example snippets

bash
php artisan vendor:publish --provider="Hamidrezaniazi\Upolo\UpoloServiceProvider" --tag="migrations"
bash
php artisan migrate
 php
$file = Upolo::upload($uploadedFile)
 php
$file = Upolo::upload($uploadedFile, $user, $owner, $disk, $flag)
 php


class Owner extends Model implements HasFileInterface
{
    use HasFileTrait;
 php


class FileController extends Controller
{
    /**
     * @param FileFilters $filters
     * @return AnonymousResourceCollection
     */
    public function index(FileFilters $filters): AnonymousResourceCollection
    {
        return FileResource::collection(File::filter($filters)->paginate());
    }
 php
$file->delete();