app/Api/V1/Controllers/AuthController.php
/**
     * upload vendors supporting document
     *
     * @param Request $request
     * @return Document
     */
upload vendors supporting document
@param Request $request
@return Document
upload vendors supporting document @param Request $request @return Document
protected function uploadSupportingDocument($request, $user)
    {
        $document = Document::getDocument($request);
        if ($documents = Document::saveDocument($document, null, 1)) {
            if (is_array($documents)) {
                foreach ($documents as $document) {
                    $document->created_by = $user->id;
                    $document->save();
                }
            } else {
                $documents->created_by = $user->id;
                $documents->save();
            }
            return $documents;
        }
        throw new StoreResourceFailedException('couldn\'t upload document');
    }
protected function uploadSupportingDocument ( $ request , $ user ) { $ document = Document :: getDocument ( $ request ) ; if ( $ documents = Document :: saveDocument ( $ document , null , 1 ) ) { if ( is_array ( $ documents ) ) { foreach ( $ documents as $ document ) { $ document -> created_by = $ user -> id ; $ document -> save ( ) ; } } else { $ documents -> created_by = $ user -> id ; $ documents -> save ( ) ; } return $ documents ; } throw new StoreResourceFailedException ( 'couldn\'t upload document' ) ; }
upload vendors supporting document
 @param Request $request
 @return Document
upload vendors supporting document @param Request $request @return Document