コード例 #1
0
ファイル: ProjectController.php プロジェクト: ymnl007/92five
 /**
  * Add files to the project
  * @return bool
  */
 public function postAddFiles()
 {
     //Get the file
     $file = \Input::file('file');
     //Get the project Id
     $project_id = \Input::get('project_id');
     //Get the user id of the currently logged in user
     $userId = Sentry::getUser()->id;
     //Upload it to the disk
     $result = \Fileupload::upload($file, $project_id, 'project', $userId);
     return $result;
 }
コード例 #2
0
ファイル: TaskController.php プロジェクト: ymnl007/92five
 /**
  * Upload files and add it to the task
  * @return JSON
  */
 public function postAddFiles($taskId)
 {
     //Get the file
     $file = \Input::file('file');
     //Get the user id of the currently logged in user
     $userId = Sentry::getUser()->id;
     //Upload the file
     $result = \Fileupload::upload($file, $taskId, 'task', $userId);
     return $result;
 }