/** * Store a newly created resource in storage. * * @return Response */ public function store(PostFormRequest $request, MediaManager $media) { $attr = $request->all(); $post = $this->post->create($attr); $post->categories()->sync($request->get('category_id', [])); return redirect(route('backend.' . $this->post_type . 's.index'))->with('success_message', 'The ' . $this->post_type . ' has been created'); }