Exemplo n.º 1
0
 /**
  * Store a newly created Apk in storage.
  * POST /apks
  *
  * @param Request $request
  *
  * @return Response
  */
 public function store(Request $request)
 {
     if (sizeof(Apk::$rules) > 0) {
         $this->validateRequestOrFail($request, Apk::$rules);
     }
     $input = $request->all();
     $apks = $this->apkRepository->create($input);
     return $this->sendResponse($apks->toArray(), "Apk saved successfully");
 }
Exemplo n.º 2
0
 /**
  * Store a newly created Apk in storage.
  *
  * @param CreateApkRequest $request
  *
  * @return Response
  */
 public function store(CreateApkRequest $request)
 {
     $input = $request->all();
     if ($request->name) {
         $apk_file = $this->uploadAPK($request->name, '/apk/');
         if ($apk_file) {
             $input['name'] = $apk_file;
         }
     }
     $apk = $this->apkRepository->create($input);
     Flash::success('Apk saved successfully.');
     return redirect(route('apks.index'));
 }