PHP code example of bildvitta / iss-upload

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

    

bildvitta / iss-upload example snippets


return [

    'validation' => [
        'mime_type' => env('ISS_IMAGE_VALID_MIME_TYPE', 'image/jpeg,image/gif,image/bmp,image/tiff,image/png,application/pdf'),
    ],

    'route' => [

        'prefix' => env('ISS_IMAGE_ROUTE_PREFIX', 'api'),

        'middleware' => env('ISS_IMAGE_ROUTE_MIDDLEWARE', 'hub.auth'),

    ]

];


use Bildvitta\IssUpload\Http\Controllers\UploadController;

Route::post('/upload-pdf')->name('upload_pdf')->uses(UploadController::class);

use Bildvitta\IssUpload\Http\Requests\UploadRequest;
use Bildvitta\IssUpload\IssUpload;
use Illuminate\Http\JsonResponse;
use App\Http\Requests\YourRequestValidator;

class NewPostController extends Controller
{
    public function __invoke(YourRequestValidator $yourRequestValidator, UploadRequest $uploadRequest): JsonResponse
    {
        #TODO: Your Logic.
        
//        $issUpload = new IssUpload($uploadRequest->entity, ($uploadRequest->filename, $uploadRequest->mime_type);
        
        $issUpload = new IssUpload();
        $issUpload->setEntity($uploadRequest->entity);
        $issUpload->setFilename($uploadRequest->filename);
        $issUpload->setMimeType($uploadRequest->mime_type);

        dd($issUpload->getUploadSource());
        
        #TODO: Your Logic.
    }
}
bash
php artisan vendor:publish --provider="Bildvitta\IssUpload\IssUploadServiceProvider" --tag="iss-upload-config"