PHP code example of mobilemaster / laravel-file-input

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

    

mobilemaster / laravel-file-input example snippets


    MobileMaster\LaravelFileInput\ServiceProvider::class,
    

echo FileInput::make([
    'uploadUrl' => 'upload',
]);

echo FileInput::init([
    'uploadUrl' => 'upload',
])->withSuffix('current')->createHtml();

public function imageFileUpload(Request $request)
{
    $path = $request->file('file_data')->store('uploads');
    return [
        'error' => NULL,
        'path' => $path,
    ];
}

    php artisan vendor:publish --provider="MobileMaster\LaravelFileInput\ServiceProvider" --tag=assets
    

    php artisan vendor:publish --provider="MobileMaster\LaravelFileInput\ServiceProvider" --tag=config
    

    php artisan vendor:publish --provider="MobileMaster\LaravelFileInput\ServiceProvider" --tag=assets --force