<?php
namespace Modules\Project\Http\Controllers\Admin;

use Encore\Admin\Form\Field\ImageField;
use Encore\Admin\Form\Field\UploadField;
use Illuminate\Http\Request;

class UploadController
{
    use UploadField,ImageField;

    public function index()
    {
    }

    public function pictures(Request $request)
    {
        $image = $request->file('file');

        $name = $this->uniqueName()->getStoreName($image);

        $this->initStorage();

        $path = $this->upload($image);

        return [
            'data' => [
                'path' => $path,
            ],
        ];
    }
}
