App\Http\Requests\Backend\EventCreateRequest::eventFillData PHP Method

eventFillData() public method

Return the fields and values to create a new news from
public eventFillData ( )
    public function eventFillData()
    {
        return ['title' => $this->title, 'event_image' => $this->event_image, 'begin_time' => $this->begin_time, 'end_time' => $this->end_time, 'content' => $this->ueditor, 'user_count' => 0, 'user_id' => Auth::user()->id];
    }

Usage Example

 /**
  * Store a newly created resource in storage.
  *
  * @param EventCreateRequest $request
  * @return Response
  */
 public function store(EventCreateRequest $request)
 {
     if ($this->repository->create($request->eventFillData())) {
         return Redirect::to('admin/event');
     } else {
         return Redirect::back()->withInput()->withErrors('保存失败!');
     }
 }