示例#1
0
 /**
  * Uploads and associates image to title.
  * 
  * @param  string $username
  * @return void
  */
 public function uploadImage()
 {
     $input = array('image' => Input::file('image'), 'title-id' => Input::get('title-id'));
     if (!$this->validator->setRules('image')->with($input)->passes()) {
         return Redirect::back()->withErrors($this->validator->errors());
     }
     $this->title->uploadImage($input);
     return Redirect::back()->withSuccess(trans('main.uploaded image success'));
 }
示例#2
0
 /**
  * Stores newly created series in database.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::except('_token');
     if (!$this->validator->with($input)->passes()) {
         return Response::json($this->validator->errors(), 400);
     }
     App::make('Lib\\Titles\\TitleCreator')->create($input);
     return Response::json(trans('dash.titleSaveSuccess'), 201);
 }