コード例 #1
0
ファイル: FolioController.php プロジェクト: makgyber/herb
 /**
  * Store a newly created Folio in storage.
  *
  * @param CreateFolioRequest $request
  *
  * @return Response
  */
 public function store(CreateFolioRequest $request)
 {
     $input = $request->all();
     $folio = $this->folioRepository->create($input);
     Flash::success('Folio saved successfully.');
     return redirect(route('folios.index'));
 }
コード例 #2
0
ファイル: FolioAPIController.php プロジェクト: makgyber/herb
 /**
  * Store a newly created Folio in storage.
  * POST /folios
  *
  * @param Request $request
  *
  * @return Response
  */
 public function store(Request $request)
 {
     if (sizeof(Folio::$rules) > 0) {
         $this->validateRequestOrFail($request, Folio::$rules);
     }
     $input = $request->all();
     $folios = $this->folioRepository->create($input);
     return $this->sendResponse($folios->toArray(), "Folio saved successfully");
 }