1. Go to this page and download the library: Download khaleghi/media 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/ */
khaleghi / media example snippets
use Khaleghi\Media\Medium;
public function YourMethod(Request $request){
if($request->has('photo')){
$medium = Medium::create([
'file' => $request->file('photo'),
]);
return back()->with('photo_url', $medium->url());
}
}