app/maguttiCms/Admin/Controllers/AjaxController.php
/**
	* This method is used to upload filemanager image or docs
	*/
This method is used to upload filemanager image or docs
This method is used to upload filemanager image or docs
public function uploadFileManager(Request $request)
	{
		$media = 'Filedata';
		if (request()->hasFile($media) && request()->file($media)->isValid()) {
			$UM = new UploadManager;
			$fileData = $UM->init($media, $request)->store()->getFileDetails();
			$c = new Media;
			$c->title = $fileData['fullName'];
			$c->file_name = $fileData['fullName'];
			$c->size = $fileData['size'];
			$c->collection_name = $fileData['mediaType'];
			$c->media_category_id = 0;
			$c->file_ext = $fileData['extension'];
			$c->save();
			$this->responseContainer['status'] = 'ok';
			$this->responseContainer['id'] = $c->id;
			$this->responseContainer['data'] = $fileData['mediaType'];
			return $this->responseHandler();
		}
	}
public function uploadFileManager ( Request $ request ) { $ media = 'Filedata' ; if ( request ( ) -> hasFile ( $ media ) && request ( ) -> file ( $ media ) -> isValid ( ) ) { $ UM = new UploadManager ; $ fileData = $ UM -> init ( $ media , $ request ) -> store ( ) -> getFileDetails ( ) ; $ c = new Media ; $ c -> title = $ fileData [ 'fullName' ] ; $ c -> file_name = $ fileData [ 'fullName' ] ; $ c -> size = $ fileData [ 'size' ] ; $ c -> collection_name = $ fileData [ 'mediaType' ] ; $ c -> media_category_id = 0 ; $ c -> file_ext = $ fileData [ 'extension' ] ; $ c -> save ( ) ; $ this -> responseContainer [ 'status' ] = 'ok' ; $ this -> responseContainer [ 'id' ] = $ c -> id ; $ this -> responseContainer [ 'data' ] = $ fileData [ 'mediaType' ] ; return $ this -> responseHandler ( ) ; } }
This method is used to upload filemanager image or docs
This method is used to upload filemanager image or docs