public function store($payload)
    {
        $result = false;

        foreach ($payload['location'] as $file) {
            $filePayload = $payload;
            $filePayload['name'] = $file['original'];
            $filePayload['location'] = CryptoService::decrypt($file['name']);
            $filePayload['mime'] = $file['mime'];
            $filePayload['size'] = $file['size'];
            $filePayload['order'] = 0;
            $filePayload['user'] = (isset($payload['user'])) ? $payload['user'] : Auth::id();
            $filePayload['is_published'] = (isset($payload['is_published'])) ? (bool) $payload['is_published'] : 0;
            $result = $this->model->create($filePayload);
        }

        return $result;
    }
public function store($payload)
    {
        $result = false;

        foreach ($payload['location'] as $file) {
            $filePayload = $payload;
            $filePayload['name'] = $file['original'];
            $filePayload['location'] = CryptoService::decrypt($file['name']);
            $filePayload['mime'] = $file['mime'];
            $filePayload['size'] = $file['size'];
            $filePayload['order'] = 0;
            $filePayload['user'] = (isset($payload['user'])) ? $payload['user'] : Auth::id();
            $filePayload['is_published'] = (isset($payload['is_published'])) ? (bool) $payload['is_published'] : 0;
            $result = $this->model->create($filePayload);
        }

        return $result;
    }
public function store ( $ payload ) { $ result = false ; foreach ( $ payload [ 'location' ] as $ file ) { $ filePayload = $ payload ; $ filePayload [ 'name' ] = $ file [ 'original' ] ; $ filePayload [ 'location' ] = CryptoService :: decrypt ( $ file [ 'name' ] ) ; $ filePayload [ 'mime' ] = $ file [ 'mime' ] ; $ filePayload [ 'size' ] = $ file [ 'size' ] ; $ filePayload [ 'order' ] = 0 ; $ filePayload [ 'user' ] = ( isset ( $ payload [ 'user' ] ) ) ? $ payload [ 'user' ] : Auth :: id ( ) ; $ filePayload [ 'is_published' ] = ( isset ( $ payload [ 'is_published' ] ) ) ? ( bool ) $ payload [ 'is_published' ] : 0 ; $ result = $ this -> model -> create ( $ filePayload ) ; } return $ result ; }
Stores Files into database.

@param array $input

@return Files
Stores Files into database .