PHP code example of atriatech / media
1. Go to this page and download the library: Download atriatech/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/ */
atriatech / media example snippets
$medium->getSubSize('thumbnail');
use Atriatech\Media\AtriatechMedia;
class Product extends Model
{
...
use AtriatechMedia;
...
}
use Atriatech\Media\Facades\AtriatechMedia;
class HomeController
{
function index()
{
$file = $request->file('file');
AtriatechMedia::upload($file, 'path'); // path is optional
}
}